feat(server): wire PgEventBus and event-driven settings cache into process assembly

main.ts starts the PG-backed SSE bus (api/worker processes now see each other's events)
and stops it on shutdown; bootstrap passes ctx.events to the settings reader so
settings.changed invalidates every process's cache.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-27 19:59:54 +08:00
1 parent ff230e5da7
commit 1cd523d3e6
2 files changed
+16 -3

No files matched your search

+1 -1
View File
@@ -147,7 +147,7 @@ export async function bootstrap(opts: BootstrapOptions): Promise<Bootstrapped> {
engine,
outbox,
secrets: createSecretStore({ db, masterKey: config.SECRET_MASTER_KEY }),
settings: createSettingsReader({ db, logger }),
settings: createSettingsReader({ db, logger, events: opts.events }),
capabilities: createCapabilityRegistry({ logger }),
};
const tasks = buildTaskRegistry(opts.modules, ctx);