method WorkersCron.prototype.on
WorkersCron.prototype.on(
expression: string,
handler: CronHandler
): this

Registers a handler for a cron expression.

Several handlers may share one expression; all of them run, and one that rejects does not prevent the others. The expression is matched exactly against ScheduledController.cron, so it must be written the same way it appears in wrangler.toml.

Parameters

expression: string

The cron expression, exactly as configured

handler: CronHandler

Invoked when that trigger fires

Return Type

this

This registry, for chaining

Usage

import { WorkersCron } from "cloudflare-plugin/src/index.ts";