fix: collapse weekly prune into the hourly cron trigger#11
Merged
Conversation
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>
|
🔎 Cloudflare preview: https://77f882ba-feedreader.phatpham9.workers.dev Uploaded from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.