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/js/90_deno_ns.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/js') diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 5364a60ee..c44c14bbe 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -24,6 +24,7 @@ import * as tty from "ext:runtime/40_tty.js"; // TODO(bartlomieju): this is funky we have two `http` imports import * as httpRuntime from "ext:runtime/40_http.js"; import * as kv from "ext:deno_kv/01_db.ts"; +import * as cron from "ext:deno_cron/01_cron.ts"; const denoNs = { metrics: core.metrics, @@ -179,6 +180,7 @@ const denoNsUnstable = { Kv: kv.Kv, KvU64: kv.KvU64, KvListIterator: kv.KvListIterator, + cron: cron.cron, }; export { denoNs, denoNsUnstable }; -- cgit v1.2.3