Skip to content

fix: collapse weekly prune into the hourly cron trigger#11

Merged
phatpham9 merged 1 commit into
mainfrom
fix/single-cron-prune-trigger
Jun 23, 2026
Merged

fix: collapse weekly prune into the hourly cron trigger#11
phatpham9 merged 1 commit into
mainfrom
fix/single-cron-prune-trigger

Conversation

@phatpham9

Copy link
Copy Markdown
Member

Deploying a second [triggers] cron entry alongside the hourly one broke wrangler deploy: the script/bindings/vars uploaded fine but the schedules API call failed ("Some triggers failed to deploy ... a request to the Cloudflare API (.../schedules) failed", no further detail surfaced by Wrangler — cloudflare/workers-sdk#14288), leaving only the original hourly trigger registered and the prune cron never created.

Instead of registering a second trigger, the existing hourly trigger now checks event.scheduledTime on every firing and runs the prune before its normal refresh when it lands in the Sunday 16:00 UTC (23:00 ICT) window — same target time, no second schedules API call.

Deploying a second [triggers] cron entry alongside the hourly one broke
`wrangler deploy`: the script/bindings/vars uploaded fine but the
schedules API call failed ("Some triggers failed to deploy ... a
request to the Cloudflare API (.../schedules) failed", no further
detail surfaced by Wrangler — cloudflare/workers-sdk#14288), leaving
only the original hourly trigger registered and the prune cron never
created.

Instead of registering a second trigger, the existing hourly trigger
now checks event.scheduledTime on every firing and runs the prune
before its normal refresh when it lands in the Sunday 16:00 UTC
(23:00 ICT) window — same target time, no second schedules API call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔎 Cloudflare preview: https://77f882ba-feedreader.phatpham9.workers.dev

Uploaded from 669810f9e16c366732064684b80c4a3d394b7481. This is a Worker version preview — it shares the production D1 database, so it reads/writes real data; it does not receive cron-triggered refreshes.

@phatpham9 phatpham9 merged commit 3998841 into main Jun 23, 2026
2 checks passed
@phatpham9 phatpham9 deleted the fix/single-cron-prune-trigger branch June 23, 2026 17:31
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