Skip to content

Move RSS and daily drains into the persistent worker - #90

Merged
BoraGkc merged 1 commit into
mainfrom
worker-owns-scheduled-drains
Sep 26, 2026
Merged

BoraGkc merged 1 commit into
mainfrom
worker-owns-scheduled-drains

Conversation

@BoraGkc

@BoraGkc BoraGkc commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Why

rss-cron.yml and full-cron.yml ran in this public repo and curled Cloud production. When the Hetzner host lost network on 2026-09-25, they started failing and emailing. Production scheduling belongs with production.

What

  • background-worker.ts: a non-blocking periodic scheduler inside the existing worker loop.
    • feeds every 6 h (fixed cadence unchanged), using RSS_CRON_MAX_FEEDS / RSS_CRON_MAX_POSTS_PER_FEED through readCronDrainConfig.
    • daily: Google indexing, Search Console sync, and expired operation_events purge (previously only the all-task drain purged them).
    • Both run once at worker start; runScheduler due checks and feed claims keep that safe. An unfinished run is never started twice, and a failure waits for the next interval.
  • Deleted rss-cron.yml, full-cron.yml, and campaign-cron.yml.
  • Updated architecture.md, operations.md, and rss-scheduler.md.

Self-hosted Compose, Dokploy, and Railway schedulers are unchanged. The Cloudflare fallback Worker is unchanged.

Verification

  • npm run test:server: all 59 self-tests pass, including new periodic-scheduler cases
  • Server tsc --noEmit is clean; git diff --check is clean

Deploy note

RSS has no scheduler between merging this and the Cloud worker image rolling out. Deploy promptly after the Cloud sync. Then remove the now-unused BLOGFACTORY_CRON_SECRET repo secret.

🤖 Generated with Claude Code

The public repository's scheduled workflows curled Cloud production from
GitHub, so a Hetzner network outage surfaced as failed public-repo runs.
The persistent worker now starts the due-feed tick every six hours and the
daily indexing, Search Console, and operation-event retention drain, both
also on worker start. Self-hosted scheduler containers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BoraGkc
BoraGkc merged commit df0b959 into main Sep 26, 2026
14 of 18 checks passed
@BoraGkc
BoraGkc deleted the worker-owns-scheduled-drains branch September 26, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant