diff options
author | Igor Zinkovsky <igor@deno.com> | 2023-11-30 15:52:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 15:52:48 -0800 |
commit | 5f6181df4a914c0d05ea3d2b63190b9ee2d764ca (patch) | |
tree | b9954f3b4bde04e8db19d3ea38df207c1d6657fb /cli/tsc | |
parent | 9444bab18647bc871b63716a3a70b2aebaaf3821 (diff) |
fix(cron): move deprecated Deno.cron overload (#21407)
Moving the deprecated `Deno.cron` overload to be the last one.
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index 895b7c0c5..1bf4d3cfd 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1348,30 +1348,28 @@ declare namespace Deno { * Create a cron job that will periodically execute the provided handler * callback based on the specified schedule. * - * `schedule` can be a string in the Unix cron format or in JSON format - * as specified by interface {@linkcode CronSchedule}, where time is specified - * using UTC time zone. - * * ```ts * Deno.cron("sample cron", "20 * * * *", () => { * console.log("cron job executed"); * }); * ``` - * `backoffSchedule` option can be used to specify the retry policy for failed - * executions. Each element in the array represents the number of milliseconds - * to wait before retrying the execution. For example, `[1000, 5000, 10000]` - * means that a failed execution will be retried at most 3 times, with 1 - * second, 5 seconds, and 10 seconds delay between each retry. + * + * ```ts + * Deno.cron("sample cron", { hour: { every: 6 } }, () => { + * console.log("cron job executed"); + * }); + * ``` + * + * `schedule` can be a string in the Unix cron format or in JSON format + * as specified by interface {@linkcode CronSchedule}, where time is specified + * using UTC time zone. * * @category Cron - * @deprecated Use other {@linkcode cron} overloads instead. This overload - * will be removed in the future. */ export function cron( name: string, schedule: string | CronSchedule, handler: () => Promise<void> | void, - options: { backoffSchedule?: number[]; signal?: AbortSignal }, ): Promise<void>; /** **UNSTABLE**: New API, yet to be vetted. @@ -1380,7 +1378,9 @@ declare namespace Deno { * callback based on the specified schedule. * * ```ts - * Deno.cron("sample cron", "20 * * * *", () => { + * Deno.cron("sample cron", "20 * * * *", { + * backoffSchedule: [10, 20] + * }, () => { * console.log("cron job executed"); * }); * ``` @@ -1389,11 +1389,18 @@ declare namespace Deno { * as specified by interface {@linkcode CronSchedule}, where time is specified * using UTC time zone. * + * `backoffSchedule` option can be used to specify the retry policy for failed + * executions. Each element in the array represents the number of milliseconds + * to wait before retrying the execution. For example, `[1000, 5000, 10000]` + * means that a failed execution will be retried at most 3 times, with 1 + * second, 5 seconds, and 10 seconds delay between each retry. + * * @category Cron */ export function cron( name: string, schedule: string | CronSchedule, + options: { backoffSchedule?: number[]; signal?: AbortSignal }, handler: () => Promise<void> | void, ): Promise<void>; @@ -1402,18 +1409,15 @@ declare namespace Deno { * Create a cron job that will periodically execute the provided handler * callback based on the specified schedule. * - * ```ts - * Deno.cron("sample cron", "20 * * * *", { - * backoffSchedule: [10, 20] - * }, () => { - * console.log("cron job executed"); - * }); - * ``` - * * `schedule` can be a string in the Unix cron format or in JSON format * as specified by interface {@linkcode CronSchedule}, where time is specified * using UTC time zone. * + * ```ts + * Deno.cron("sample cron", "20 * * * *", () => { + * console.log("cron job executed"); + * }); + * ``` * `backoffSchedule` option can be used to specify the retry policy for failed * executions. Each element in the array represents the number of milliseconds * to wait before retrying the execution. For example, `[1000, 5000, 10000]` @@ -1421,12 +1425,14 @@ declare namespace Deno { * second, 5 seconds, and 10 seconds delay between each retry. * * @category Cron + * @deprecated Use other {@linkcode cron} overloads instead. This overload + * will be removed in the future. */ export function cron( name: string, schedule: string | CronSchedule, - options: { backoffSchedule?: number[]; signal?: AbortSignal }, handler: () => Promise<void> | void, + options: { backoffSchedule?: number[]; signal?: AbortSignal }, ): Promise<void>; /** **UNSTABLE**: New API, yet to be vetted. |