MCPcopy
hub / github.com/node-cron/node-cron / shouldRun

Method shouldRun

src/coordinator/run-coordinator.ts:16–16  ·  view source on GitHub ↗

* Return `true` if THIS instance should run the fire identified by `key`, * `false` to skip it (another instance handles it). Throw to fail closed * (the run is skipped). `ttlMs` is a safety lease hint for lease-based * coordinators (a Redis lock uses it; config-based ones ignore it).

(key: string, ttlMs: number)

Source from the content-addressed store, hash-verified

14 * coordinators (a Redis lock uses it; config-based ones ignore it).
15 */
16 shouldRun(key: string, ttlMs: number): boolean | Promise<boolean>;
17 /**
18 * Called after the run completes (success or failure); e.g. release a lock.
19 * Config-based coordinators leave it unimplemented.

Callers 4

runCoordinatedMethod · 0.65
handleShouldRunMethod · 0.65

Implementers 2

EnvVarRunCoordinatorsrc/coordinator/env-var-run-coordinato
IpcRunCoordinatorsrc/coordinator/ipc-run-coordinator.ts

Calls

no outgoing calls

Tested by

no test coverage detected