Skip to content

Conversation

@penalosa
Copy link
Contributor

Summary

The /cdn-cgi/handler/scheduled works for both Python and non-Python workers, and doesn't require the --test-scheduled flag.

Documentation checklist

@hyperlint-ai
Copy link
Contributor

hyperlint-ai bot commented Apr 23, 2025

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Clarified the process for testing cron triggers locally and updated documentation to reflect changes in cron trigger propagation.

  • Updated the testing instructions for Cron Triggers to remove the need for the --test-scheduled flag.
  • Added a note about the propagation time for Cron Trigger changes.
  • Clarified the usage of the /cdn-cgi/handler/scheduled route for testing.

Modified Files

  • src/content/docs/workers/configuration/cron-triggers.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 23, 2025

curl "http://localhost:8787/cdn-cgi/handler/scheduled?cron=*+*+*+*+*"
```

Optionally, you can also pass a `time` query parameter to override `controller.scheduledTime` in your scheduled event listener.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to have a code snippet for this as well

## Test Cron Triggers locally

Test Cron Triggers using `Wrangler` by passing in the `--test-scheduled` flag to [`wrangler dev`](/workers/wrangler/commands/#dev). This will expose a `/__scheduled` (or `/cdn-cgi/handler/scheduled` for Python Workers) route which can be used to test using a HTTP request. To simulate different cron patterns, a `cron` query parameter can be passed in.
Test Cron Triggers using Wrangler with [`wrangler dev`](/workers/wrangler/commands/#dev). This will expose a `/cdn-cgi/handler/scheduled` route which can be used to test using a HTTP request. To simulate different cron patterns, a `cron` query parameter can be passed in.
Copy link
Contributor

@CarmenPopoviciu CarmenPopoviciu Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Cron Triggers using Wrangler with wrangler dev. This will expose a /cdn-cgi/handler/scheduled route which can be used to test using a HTTP request.

curl "http://localhost:8787/cdn-cgi/handler/scheduled

To simulate different cron patterns, a cron query parameter can be passed in.

@penalosa penalosa enabled auto-merge (squash) April 28, 2025 16:04
@penalosa penalosa merged commit 568ab1f into production Apr 28, 2025
13 checks passed
@penalosa penalosa deleted the penalosa-patch-2 branch April 28, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants