Skip to content

Commit

Permalink
fix(delayed): remove marker after being consumed (#1620) fixes #1615
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Jan 7, 2023
1 parent 4a6db4d commit 9fce0f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/classes/worker.ts
Expand Up @@ -486,7 +486,6 @@ export class Worker<
// block timeout.
if (jobId && jobId.startsWith('0:')) {
this.blockTimeout = parseInt(jobId.split(':')[1]);
return;
}
const [jobData, id, limitUntil, delayUntil] =
await this.scripts.moveToActive(token, jobId);
Expand Down
5 changes: 4 additions & 1 deletion tests/test_delay.ts
Expand Up @@ -122,7 +122,6 @@ describe('Delayed jobs', function () {
const delayedJobs = await queue.getDelayed();
expect(delayedJobs.length).to.be.equal(1);
expect(publishHappened).to.be.eql(true);
await worker.close();
resolve();
} catch (err) {
reject(err);
Expand All @@ -147,6 +146,10 @@ describe('Delayed jobs', function () {

await delayed;
await completed;

const count = await queue.getJobCountByTypes('active');
expect(count).to.be.equal(0);

await queueEvents.close();
await worker.close();
});
Expand Down

0 comments on commit 9fce0f0

Please sign in to comment.