Skip to content

1.0.1

Latest

Choose a tag to compare

@padcmoi padcmoi released this 06 May 08:10

[1.0.1] - 2026-05-06

  • Added optional finishedTtlDays option on DelayedTaskServiceOptions. When set to a positive number, every record written to the FINISH bucket gets a Redis EX TTL of finishedTtlDays × 86400 seconds — successful tasks are auto-purged by Redis past that window. Disabled by default; never applies to PENDING / FAILED / CANCELED.

[1.0.0] - 2026-05-06

  • Pure-Redis storage. No MariaDB, no TypeORM, no entity, no migrations.
  • Four buckets per namespace: <NS>:PENDING:task-<id>, <NS>:FINISH:task-<id> (success), <NS>:FAILED:task-<id> (handler error / timeout / no handler), <NS>:CANCELED:task-<id> (replayable).
  • Auto-increment integer IDs via INCR <NS>:counter.
  • Polling scheduler (default 1000ms), processes pending tasks in ID order when scheduledAt <= now.
  • Weight-aware execution capped by maxWeight (default 5): a task starts only if Σ(running.weight) + task.weight <= maxWeight.
  • Service API: enqueue, cancel, replay, setWeight, get, has, list.pending, list.finished, list.failed, list.canceled, start, stop.
  • enqueue clamps weight to the live maxWeight. setWeight(id, weight) updates a still-pending task's weight (also clamped) — useful when maxWeight was lowered between deploys.
  • Typed dispatch: enqueue(definition, options) overload infers options.data from the TaskDefinition<P> generic. defineTask<P, R> already typed data inside run; this propagates the type all the way to the call site.
  • Cancelled or failed tasks can be replayed; replay(id) auto-detects the source bucket (CANCELED or FAILED) and accepts an optional future scheduledAt (otherwise keeps the original).
  • scheduledAt accepts Date, number (seconds from now), or string (ISO date or numeric seconds-from-now).
  • resolveScheduledAt exported as a public utility.
  • POC emitters accept scheduledAt and weight via query string.
  • Removed: TypeOrmTaskStore, RedisPriorityIndex, DispatchedTask entity, configureDispatchedTask, tableName, taskStoreFactory, idempotencyKey, correlationId, source, callback, ULID generator, retry/backoff, Zod inputSchema validation.
  • Removed peer dependencies: typeorm, zod. Only ioredis remains.