docs: fix README examples and driver imports · boringnode/queue@a6525fa · GitHub
Skip to content

Commit a6525fa

Browse files
committed
docs: fix README examples and driver imports
- The exponential backoff example wrapped the factory in another function. It failed to typecheck and threw "getNextRetryAt is not a function" on the first retry. - The fixed backoff example passed an options object; fixedBackoff() takes a duration and threw "val.toLowerCase is not a function". - The dedup section suggested ttl: 0 for no expiry, then said it is rejected. It is rejected. - The dedup section promised race-free Knex/Kysely dedup; the partial unique index that makes it race-free only exists on PostgreSQL and SQLite. - The schedule options table now says .id() defaults to the job name, and that scheduling the same job twice replaces the first schedule. - Three JSDoc examples imported redis from the package root, which does not export it. A typed test mirrors the corrected backoff examples so a signature change breaks the build.
1 parent fd254ba commit a6525fa

5 files changed

Lines changed: 47 additions & 24 deletions

File tree

‎README.md‎

Lines changed: 23 additions & 21 deletions

‎src/contracts/adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface AcquiredJob extends JobData {
3636
*
3737
* @example
3838
* ```typescript
39-
* import { redis } from '@boringnode/queue'
39+
* import { redis } from '@boringnode/queue/drivers/redis_adapter'
4040
*
4141
* const config = {
4242
* default: 'redis',

‎src/queue_manager.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ type QueueManagerFakeState = {
3737
*
3838
* @example
3939
* ```typescript
40-
* import { QueueManager, redis } from '@boringnode/queue'
40+
* import { QueueManager, exponentialBackoff } from '@boringnode/queue'
41+
* import { redis } from '@boringnode/queue/drivers/redis_adapter'
4142
*
4243
* await QueueManager.init({
4344
* default: 'redis',

‎src/worker.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import {
3030
*
3131
* @example
3232
* ```typescript
33-
* import { Worker, redis } from '@boringnode/queue'
33+
* import { Worker } from '@boringnode/queue'
34+
* import { redis } from '@boringnode/queue/drivers/redis_adapter'
3435
*
3536
* const worker = new Worker({
3637
* default: 'redis',

‎tests/backoff_strategy.spec.ts‎

Lines changed: 19 additions & 0 deletions

0 commit comments

Comments
 (0)