Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
feat: added resume method
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Sep 10, 2019
1 parent 83d738e commit 3cc6999
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ class Bull {
);
}

return this.resume(name);
}

async resume(name) {
if (!name) {
this.config.logger.info('resuming all job queues');
return Promise.all([...this.queues.keys()].map(key => this.resume(key)));
}

const queue = this.queues.get(name);
if (!queue) throw new Error(`Queue "${name}" does not exist`);
this.config.logger.info(`resuming job queue`, this._getMeta({ queue }));
return queue.resume();
}

Expand Down

0 comments on commit 3cc6999

Please sign in to comment.