feat(03-04): wire startOutboxWorker into index.ts at boot

- Import startOutboxWorker beside startBrokerPoller import
- Call startOutboxWorker() immediately after startBrokerPoller()
- Worker drains D-05 outbox every 15s alongside the 5-min ctag poller
This commit is contained in:
Lucas Berger
2026-06-05 18:20:50 -04:00
parent cd4a8931e5
commit 026aebccdf
+3
View File
@@ -8,6 +8,7 @@ import { sseRouter } from './routes/sse.js'
import { oidcAuthMiddleware, processOAuthCallback } from './auth/middleware.js' import { oidcAuthMiddleware, processOAuthCallback } from './auth/middleware.js'
import { devAuthBypass } from './auth/devBypass.js' import { devAuthBypass } from './auth/devBypass.js'
import { startBrokerPoller } from './broker/poller.js' import { startBrokerPoller } from './broker/poller.js'
import { startOutboxWorker } from './broker/outboxWorker.js'
export const app = new Hono() export const app = new Hono()
@@ -52,6 +53,8 @@ app.route('/api/sse', sseRouter)
// Start the CalDAV broker poller (5-min cron, D-13 ctag change-detection) // Start the CalDAV broker poller (5-min cron, D-13 ctag change-detection)
// Runs in the background — errors are caught and logged per-credential (T-03-04) // Runs in the background — errors are caught and logged per-credential (T-03-04)
startBrokerPoller() startBrokerPoller()
// Drain the D-05 outbox every 15s: dispatches pending CalDAV writes to Fastmail
startOutboxWorker()
// Serve React PWA static assets from ./public (Vite build output) // Serve React PWA static assets from ./public (Vite build output)
app.use('/assets/*', serveStatic({ root: './public' })) app.use('/assets/*', serveStatic({ root: './public' }))