Repository navigation
feat(storage): add eventStore.backend setting and a single event repository factory - #806
Anshumancanrock wants to merge 5 commits into
Conversation
🦋 Changeset detectedLatest commit: 7765b37 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
| // Resolve once so every worker shares it and a bad value fails before forking. | ||
| let eventStoreBackend: EventStoreBackend | ||
| try { | ||
| eventStoreBackend = getConfiguredEventStoreBackend(settings) |
There was a problem hiding this comment.
eventStore.backend now needs a restart, but the settings PATCH API still labels it hot-reload. getSettingsReloadBehavior only marks workers., payments, and network. as restart-required, so clients receive the wrong guidance for this setting.
Add the new setting to that helper and test its PATCH response. Only postgres is supported today, so this is a non-blocking API guidance issue rather than an incorrect store switch.
Description
Adds an
eventStore.backendsetting and acreateEventRepositoryfactory. All nine places that builtEventRepositorydirectly now go through the factory.postgresis the default and the only value for now, so nothing changes for existing relays.EVENT_STORE_BACKEND, so a re-forked worker gets the same store.validateSettings, and the relay exits with an error before forking any worker.CONFIGURATION.mdanddefault-settings.yaml.Related Issue
Closes #802
Motivation and Context
First step toward serving events from strfry behind
IEventRepository. Landing the seam on its own keeps the backend PR free of call-site changes.The setting is read once because workers hot-reload
settings.yaml, and the invoice, admission and payment-callback handlers build a repository on every request. A live read could split a running relay across two stores, or turn those endpoints into 500s after a typo.How Has This Been Tested?
pnpm test:unit: 2107 passing, 24 of them new.pnpm lint,build:checkandcheck:depsare clean.Types of changes
Checklist: