diff options
author | Igor Zinkovsky <igor@deno.com> | 2023-11-01 11:57:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 11:57:55 -0700 |
commit | 01d3e0f317ca180bbf0ac8a17c6651869110e02f (patch) | |
tree | b8e3bb91e87cf396bfa782f6377158f8a170b32b /cli/build.rs | |
parent | 82643857cc77a80f9a819584035ec147a6114553 (diff) |
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`.
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/build.rs b/cli/build.rs index e6b9dc0a4..b7a452465 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -349,6 +349,7 @@ deno_core::extension!( fn create_cli_snapshot(snapshot_path: PathBuf) -> CreateSnapshotOutput { use deno_core::Extension; use deno_runtime::deno_cache::SqliteBackedCache; + use deno_runtime::deno_cron::local::LocalCronHandler; use deno_runtime::deno_http::DefaultHttpPropertyExtractor; use deno_runtime::deno_kv::sqlite::SqliteDbHandler; use deno_runtime::permissions::PermissionsContainer; @@ -383,6 +384,7 @@ fn create_cli_snapshot(snapshot_path: PathBuf) -> CreateSnapshotOutput { deno_kv::deno_kv::init_ops(SqliteDbHandler::<PermissionsContainer>::new( None, None, )), + deno_cron::deno_cron::init_ops(LocalCronHandler::new()), deno_napi::deno_napi::init_ops::<PermissionsContainer>(), deno_http::deno_http::init_ops::<DefaultHttpPropertyExtractor>(), deno_io::deno_io::init_ops(Default::default()), |