OptionalstoreWhere durable tasks persist their state. Default: an in-memory store, which keeps
the in-process semantics (nothing survives a restart; a warning is logged once).
Use the schedules() of SQLiteStore, RedisStore, PostgresStore, MysqlStore
or MongoStore (or any implementation).
OptionalleaseOptional leadership, which saves store round-trips with many replicas: the replica
holding the scheduler:leader lease claims occurrences on time; the others only claim
one left overdue for leaderTtlMs (a task only they registered, or a dead leader).
Correctness never depends on it: per-occurrence claims are fenced anyway.
Either a fenced LeaseProvider (MemoryLeaseProvider, RedisStore#leases())
or a multi-replica Coordinator (RedisCoordinator, MemoryCoordinator), whose
tryLead leadership is used. A bot with BotConfig.coordination defaults to its
coordinator here.
OptionalownerThis process's lease-owner id. Default: a random id per scheduler.
OptionaltickPoll period for durable tasks (duration or ms, default '1s'): picks up occurrences
whose runner crashed (once its lease expires) and retries after store errors. It is
also the grace period (plus twice leaderTtlMs with a lease): a slot claimed later
than that after it fell due counts as missed (no replica ran it in time).
OptionalleaderTTL of the scheduler:leader lease when lease is set (duration or ms, default
'30s'). With a Coordinator lease the coordinator renews the leadership itself;
this is then only the follower's grace before it steps in (default: the
coordinator's leaseMs when it exposes one, else '30s').
OptionalnowClock used for durable tasks (epoch ms). For tests; default Date.now.
OptionaltimeDefault IANA zone ('America/Bogota', 'Europe/Madrid', 'UTC', or 'local') the
cron fields of this scheduler's cron tasks are read in, plain and durable alike; a
task's own timeZone overrides it. Default: the process zone (today's behaviour).
Validated at construction (RangeError for an unknown zone). See
CronTaskOptions.timeZone for the daylight-saving rules.
Options of a
Scheduler(and ofBotConfig.scheduler). They only affect durable tasks — plainschedule/every/delay(spec, fn)tasks stay in-memory.