From efde85ddbea854d68d253b62d9b115b400fa367b Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Mon, 2 Nov 2020 14:59:46 -0600 Subject: [PATCH] Document cron triggers wrangler config format --- .../src/content/cli-wrangler/configuration.md | 17 +++++++++++++++++ .../src/content/platform/cron-triggers/index.md | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/products/workers/src/content/cli-wrangler/configuration.md b/products/workers/src/content/cli-wrangler/configuration.md index a7e51a4088ca3e5..bcb223404136ad3 100644 --- a/products/workers/src/content/cli-wrangler/configuration.md +++ b/products/workers/src/content/cli-wrangler/configuration.md @@ -74,6 +74,9 @@ Keys to configure per project in your `wrangler.toml`. - `dev` not inherited optional - Arguments for `wrangler dev`, configure local server +- `triggers` inherited optional + - Configures cron triggers for executing a Worker on a schedule + ### vars @@ -229,6 +232,20 @@ You can learn more about the standard patterns used for include and exclude in t Workers Sites projects use webpack by default. You can [bring your own webpack config](/cli-wrangler/webpack#using-with-workers-sites), however it is important to be cognizant of your `entry` and `context` settings. +### triggers + +A set of cron triggers used to call a Worker on a schedule. + +Usage: + +```toml +[triggers] +crons = ["0 0 * JAN-JUN FRI", "0 0 LW JUL-DEC *"] +``` + +- `crons` optional + - A set of cron expressions, where each expression is a separate schedule to run the Worker on. + ### dev Arguments for `wrangler dev` can be configured here so you don't have to repeatedly pass them. diff --git a/products/workers/src/content/platform/cron-triggers/index.md b/products/workers/src/content/platform/cron-triggers/index.md index 45bcc70e1dfd92c..4f7daf5130a458e 100644 --- a/products/workers/src/content/platform/cron-triggers/index.md +++ b/products/workers/src/content/platform/cron-triggers/index.md @@ -10,7 +10,7 @@ Cron Triggers allow users to map a cron expression to a Worker script using a [S ## Adding Cron Triggers -Cron Triggers can be added to scripts with the Cloudflare API or in the dashboard on a [Workers Triggers tab](https://dash.cloudflare.com/?to=/:account/workers) up to the [per-script limit](/platform/limits). +Cron Triggers can be added to scripts with the Cloudflare API, or in the dashboard on a [Workers Triggers tab](https://dash.cloudflare.com/?to=/:account/workers) up to the [per-script limit](/platform/limits). If a script is managed with Wrangler, Cron Triggers should be exclusively managed through the **`wrangler.toml`** file. ![workers-schedule-editor](./media/workers-schedule-editor.png)