Setu-TS
    Preparing search index...

    Interface DistributedLockOptions

    Options for distributed locking.

    interface DistributedLockOptions {
        acquireTimeoutMs?: number;
        client?: IRedisLockClient;
        commandTimeoutMs?: number;
        enabled?: boolean;
        lock?: IDistributedLock;
        storage?: "redis";
        ttlMs?: number;
        url?: string;
    }
    Index
    acquireTimeoutMs?: number

    How long one lock acquire may run before the fire it serves is skipped and counted lock-failed (M101a V8-24). Bounds every acquire the scheduler makes — the fire slot, the handler mutex and the delay slot claimed at registration — for EVERY lock, including an injected lock, so a lock backend that stops answering skips fires instead of stopping them. Keep it below the job's interval. An acquire abandoned at the bound that later returns a token has that token released.

    0 disables the bound. Must be a number from 0 to 2147483647.

    5000
    

    0.9.0

    Injected ioredis-compatible client (preferred over lazy load).

    commandTimeoutMs?: number

    ioredis commandTimeout for the Redis client the lock BUILDS (storage: 'redis' with no client), so a parked SET NX rejects on the client rather than waiting for the TCP connection. Never applied to an injected client or lock.

    Defaults to the resolved acquireTimeoutMs (and to 15000 when that is 0); a value greater than a non-zero acquireTimeoutMs is refused, because the command must not outlast the call it bounds. 0 disables the bound.

    0.9.0

    enabled?: boolean

    Enable distributed locking. Default false.

    Custom lock implementation. Takes priority over storage when present.

    storage?: "redis"

    Lock backend. Only 'redis' is supported when enabled: true.

    ttlMs?: number

    Lock TTL in milliseconds. Must exceed the job's worst-case runtime.

    Bounds TWO distinct guarantees (M70l C3): how long the per-handler OVERLAP mutex lives after a holder dies without releasing, and how long a claimed fire SLOT is remembered before a late replica may re-run it — slot locks are never released, so this value is the replica-skew window. A value below the maximum skew between replicas lets a slow replica re-run an already-claimed fire.

    30000
    
    url?: string

    Redis connection URL. Default 'redis://localhost:6379'.