diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 28070ad44f..6cc4f5ed1d 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -228,11 +228,11 @@ declare namespace Bull { } interface JobCounts { - wait: number; active: number; completed: number; failed: number; delayed: number; + waiting: number; } interface JobInformation { @@ -384,21 +384,27 @@ declare namespace Bull { /** * Returns a promise that resolves when the queue is paused. - * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. - * A paused queue will not process new jobs until resumed, - * but current jobs being processed will continue until they are finalized. + * + * A paused queue will not process new jobs until resumed, but current jobs being processed will continue until + * they are finalized. The pause can be either global or local. If global, all workers in all queue instances + * for a given queue will be paused. If local, just this worker will stop processing new jobs after the current + * lock expires. This can be useful to stop a worker from taking new jobs prior to shutting down. * * Pausing a queue that is already paused does nothing. */ - pause(): Promise; + pause(isLocal?: boolean): Promise; /** * Returns a promise that resolves when the queue is resumed after being paused. - * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * The resume can be either local or global. If global, all workers in all queue instances for a given queue + * will be resumed. If local, only this worker will be resumed. Note that resuming a queue globally will not + * resume workers that have been paused locally; for those, resume(true) must be called directly on their + * instances. * * Resuming a queue that is not paused does nothing. */ - resume(): Promise; + resume(isLocal?: boolean): Promise; /** * Returns a promise that returns the number of jobs in the queue, waiting or paused. @@ -445,6 +451,11 @@ declare namespace Bull { */ getFailed(start?: number, end?: number): Promise; + /** + * Returns a promise that will return an array with the waiting jobs between start and end. + */ + getWaiting(start?: number, end?: number): Promise; + /** * Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end * index to limit the number of results. Start defaults to 0, end to -1 and asc to false.