2023-04-30 10:35:04 +09:00
|
|
|
# [Cron](https://developers.cloudflare.com/workers/platform/triggers/cron-triggers/)
|
|
|
|
|
|
|
|
* Create a worker to be triggered by Cron.
|
|
|
|
|
|
|
|
## Development
|
|
|
|
|
|
|
|
### Requirements
|
|
|
|
|
|
|
|
This project requires these tools to be installed globally.
|
|
|
|
|
|
|
|
* wrangler
|
|
|
|
* tinygo
|
|
|
|
|
|
|
|
### Commands
|
|
|
|
|
|
|
|
```
|
|
|
|
make dev # run dev server
|
|
|
|
make build # build Go Wasm binary
|
2023-05-21 11:56:31 +09:00
|
|
|
make deploy # deploy worker
|
2023-04-30 10:35:04 +09:00
|
|
|
```
|
2024-11-08 02:16:35 +09:00
|
|
|
|
|
|
|
#### Testing cron schedule
|
|
|
|
|
|
|
|
* With curl command below, you can test the cron schedule.
|
|
|
|
- see: https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/#background
|
|
|
|
|
|
|
|
```
|
|
|
|
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
|
|
|
|
```
|