Interface StartOptions

    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.

    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

    batchRetentionCount?: number

    Count cap for finalized batch rows. See completedRetentionCount. Default: undefined.

    batchRetentionSecs?: number

    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.

    cancelledRetentionCount?: number

    Count cap for cancelled jobs. See completedRetentionCount. Default: undefined.

    cancelledRetentionSecs?: number

    Retention (seconds) for cancelled jobs. Default 604_800 (7d). Pass -1 to keep forever.

    cleanupIntervalMs?: number

    How often the cleanup task deletes finalized jobs past retention. Default 300_000 (5m).

    completedRetentionCount?: number

    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.

    completedRetentionSecs?: number

    Retention (seconds) for completed jobs. Default 86_400 (24h). Pass -1 to keep forever (table grows unbounded).

    failedRetentionCount?: number

    Count cap for failed jobs. See completedRetentionCount. Default: undefined.

    failedRetentionSecs?: number

    Retention (seconds) for failed jobs. Default 604_800 (7d). Pass -1 to keep forever.

    fetchPollIntervalMs?: number

    Fetch poll interval in poll-only mode (no LISTEN/NOTIFY). Default 1_000 (1s). Ignored when LISTEN is enabled.

    heartbeatIntervalMs?: number

    How often each running handler refreshes its lease. Default 15_000 (15s).

    leaderLeaseSecs?: number

    Leader-election lease in seconds — the elected maintenance node (scheduler + cleanup) refreshes every leaseSecs / 3 seconds. Default 30.

    schedulerIntervalMs?: number

    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.

    skipMigrationCheck?: boolean

    Skip the pending-migration check. Default falsestart() 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.

    staleAfterMs?: number

    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.

    sweepIntervalMs?: number

    How often the heartbeat sweeper reclaims stale running jobs. Default 30_000 (30s).