perf(scheduler): harden jobs for scalable execution

This commit is contained in:
2026-05-20 12:19:27 +08:00
parent 4b09a34748
commit 5fb9d0b0dd
23 changed files with 887 additions and 147 deletions
@@ -56,7 +56,7 @@ func markMonitoringStaleReceivedTasks(ctx context.Context, tx pgx.Tx, now time.T
AND (
request_payload_json IS NULL
OR jsonb_typeof(request_payload_json) <> 'object'
OR COALESCE(NULLIF(request_payload_json ->> 'received_alerted_at', ''), '') = ''
OR NOT (request_payload_json ? 'received_alerted_at')
)
ORDER BY callback_received_at ASC, id ASC
FOR UPDATE SKIP LOCKED