What's the difference between `--local` & `--test-scheduled` for local development?
I use wrangler (v2.9) to initialize my worker project (a scheduled worker).
The top message in the
index.ts
file says:
Run wrangler dev --local
in your terminal to start a development server
But in this doc (https://developers.cloudflare.com/workers/runtime-apis/scheduled-event/) it says:
wrangler dev --test-scheduled
So what's the difference? ScheduledEvent · Cloudflare Workers docs
A ScheduledEvent is the event type for scheduled requests to a Worker. It is the Object passed through as the event when a Worker is invoked by a …
1 Reply
—local
runs the Worker locally. Without this flag, it is run on the actual CF Edge, and then tunneled back to you. —test-scheduled
allows you to test Cron triggers that don’t run very often, by allowing you to run curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
to test them