Run each repository's time-driven work from its RepoState alarm instead of crons over every repository

Scheduled workflows fire at their next_run_at, CI caches and job tokens expire, webhook deliveries age out, orphaned attachments are swept, hidden-ref cleanups retry and jobs on runners that stopped heartbeating are failed, all inside the repository's own object. A write to one of those tables arms the alarm, a failing task backs off, and idle repositories cost nothing. Runner registrations expire from the AccountState alarm. A cron backfill arms repositories whose rows predate this.

Assisted-by: Crush
taigrrcommitted parent 641fcb332e5c365bd9b286c464b3c3ffb2d3743646bdc51Browse files
20 files changed+416−182

Rendering diff…