From 01d3e0f317ca180bbf0ac8a17c6651869110e02f Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Wed, 1 Nov 2023 11:57:55 -0700 Subject: feat(cron) implement Deno.cron() (#21019) This PR adds unstable `Deno.cron` API to trigger execution of cron jobs. * State: All cron state is in memory. Cron jobs are scheduled according to the cron schedule expression and the current time. No state is persisted to disk. * Time zone: Cron expressions specify time in UTC. * Overlapping executions: not permitted. If the next scheduled execution time occurs while the same cron job is still executing, the scheduled execution is skipped. * Retries: failed jobs are automatically retried until they succeed or until retry threshold is reached. Retry policy can be optionally specified using `options.backoffSchedule`. --- runtime/build.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/build.rs') diff --git a/runtime/build.rs b/runtime/build.rs index ce1896e6f..2c6f0a4d8 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -223,6 +223,9 @@ mod startup_snapshot { deno_kv::deno_kv::init_ops_and_esm(deno_kv::sqlite::SqliteDbHandler::< Permissions, >::new(None, None)), + deno_cron::deno_cron::init_ops_and_esm( + deno_cron::local::LocalCronHandler::new(), + ), deno_napi::deno_napi::init_ops_and_esm::(), deno_http::deno_http::init_ops_and_esm::(), deno_io::deno_io::init_ops_and_esm(Default::default()), -- cgit v1.2.3