Repository navigation
feat: schedule expired link reports at night - #5347
doubleface wants to merge 5 commits into
Conversation
c2a89a8 to
ddb0362
Compare
313da4a to
63b99e7
Compare
|
Only one stack should make the nightly reports, but today each process runs its own full scan: Suggestion: under the existing scan lock, check a "this night's scan is done" marker in the jobs Redis, e.g. |
|
Thanks @shepilov, I went with your suggestion. The scanner checks a per-window marker in the jobs Redis under the existing scan lock. It writes the marker only after a complete scan, with a TTL to the end of the window. That prevents another producer from rescanning after the queue drains or after a restart, even if it has no local workers. Failed or cancelled scans leave no marker and can retry within the window. The marker records scan completion, not report delivery. |
Summary
drive.public_link_events.enabledis on. Scans start at 02:00 UTC or on startup before 06:00 UTC, and catch up eligible expirations without a fixed lookback. New report work starts only from 02:00 inclusive to 06:00 exclusive UTC; work already started can finish later.redis.addrsand noredis.master? If so, how is the multi-keyBRPOPhandled when the report queue keys are in different slots?CROSSSLOTcan leave report jobs queued and prevent later scans. This topology is not confirmed in production; this PR documents the risk without adding a guard.