From 1837dd25a3d572edcdb554f409b090946cab4705 Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Tue, 7 Jul 2026 22:42:20 -0400 Subject: [PATCH] fix(cron): arm Meili search sink during ingest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cron handler called ensureInit(db) without platform env, so searchSinkBackend never armed and firehose ingest wrote nothing to Meili on scheduled ticks — only manual backfills carried docs, leaving the index static while D1 grew. Pass platform!.env exactly as the xrpc handler does so the sink is configured during cron ingest. ensureInit already isolates applySettings failure internally, so the handler's per-stage try/catch isolation is unchanged. --- apps/web/src/routes/api/cron/+server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/routes/api/cron/+server.ts b/apps/web/src/routes/api/cron/+server.ts index 6f19117..6308d67 100644 --- a/apps/web/src/routes/api/cron/+server.ts +++ b/apps/web/src/routes/api/cron/+server.ts @@ -25,7 +25,7 @@ export const POST: RequestHandler = async ({ request, platform }) => { // Firehose ingest — guarded so an over-budget cycle can't 500 the whole tick // (which previously also took the bot down with it). try { - await ensureInit(db); + await ensureInit(db, platform!.env); // Two deliberately-split budgets. contrail saves the jetstream cursor LAST in // runIngestCycle — after the drain, applyEvents, and the per-DID // refreshStaleIdentities network tail. If this handler aborts before that -- 2.51.2