Interface StartOptions
batchRetentionCount?: number;
batchRetentionSecs?: number;
cancelledRetentionCount?: number;
cancelledRetentionSecs?: number;
cleanupIntervalMs?: number;
completedRetentionCount?: number;
completedRetentionSecs?: number;
failedRetentionCount?: number;
failedRetentionSecs?: number;
fetchPollIntervalMs?: number;
heartbeatIntervalMs?: number;
leaderLeaseSecs?: number;
schedulerIntervalMs?: number;
skipMigrationCheck?: boolean;
staleAfterMs?: number;
sweepIntervalMs?: number;
}
Index
Properties
Properties
OptionalbatchRetentionCount
Count cap for finalized batch rows. See completedRetentionCount.
Default: undefined.
OptionalbatchRetentionSecs
Retention (seconds) for finalized batch rows (eddyq_batches).
Default 604_800 (7d). Pass -1 to keep forever — the table will
grow unbounded for batch-heavy workloads.
OptionalcancelledRetentionCount
Count cap for cancelled jobs. See completedRetentionCount.
Default: undefined.
OptionalcancelledRetentionSecs
Retention (seconds) for cancelled jobs. Default 604_800 (7d).
Pass -1 to keep forever.
OptionalcleanupIntervalMs
How often the cleanup task deletes finalized jobs past retention. Default 300_000 (5m).
OptionalcompletedRetentionCount
Count cap for completed jobs — keep at most N newest. Combined with
completedRetentionSecs using OR semantics: a row is reaped if it
exceeds either bound. Useful as a hard memory bound on Redis where
age alone (24h at high throughput = tens of GB) is not enough.
Default: undefined (no count cap). Pass -1 to explicitly disable.
OptionalcompletedRetentionSecs
Retention (seconds) for completed jobs. Default 86_400 (24h).
Pass -1 to keep forever (table grows unbounded).
OptionalfailedRetentionCount
Count cap for failed jobs. See completedRetentionCount.
Default: undefined.
OptionalfailedRetentionSecs
Retention (seconds) for failed jobs. Default 604_800 (7d).
Pass -1 to keep forever.
OptionalfetchPollIntervalMs
Fetch poll interval in poll-only mode (no LISTEN/NOTIFY). Default 1_000 (1s). Ignored when LISTEN is enabled.
OptionalheartbeatIntervalMs
How often each running handler refreshes its lease. Default 15_000 (15s).
OptionalleaderLeaseSecs
Leader-election lease in seconds — the elected maintenance node
(scheduler + cleanup) refreshes every leaseSecs / 3 seconds.
Default 30.
OptionalschedulerIntervalMs
How often the leader scheduler loop fires due schedules + promotes
delayed jobs. Default 5_000 (5s). Lower values make { every: ms }
interval schedules feel more responsive at the cost of more leader
round-trips. Don't push below ~50ms.
OptionalskipMigrationCheck
Skip the pending-migration check. Default false — start() errors
out if any registered migration isn't applied, so you never boot
workers against a stale schema.
Set to true only when you've applied migrations via a separate
deploy step (recommended) and don't want the boot-time check.
OptionalstaleAfterMs
A running job is considered stale if its heartbeat is older than this.
The sweeper requeues stale jobs on the next tick. Default 60_000 (60s).
Should be at least 2× heartbeatIntervalMs.
OptionalsweepIntervalMs
How often the heartbeat sweeper reclaims stale running jobs. Default 30_000 (30s).
Options for
eddyq.start(). All tuning fields are optional — omit to use the core defaults. Defaults are sensible for most workloads; tune only when you have a measured reason to.