From baf6a3bb98495e3feeb29a3a6b5d6dd36f48ca1a Mon Sep 17 00:00:00 2001 From: marshall007 Date: Wed, 7 Jun 2017 17:34:50 -0500 Subject: [PATCH] @types/bull: `ready` event was replaced by `Queue#isReady()` --- types/bull/bull-tests.tsx | 1 - types/bull/index.d.ts | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index e0854cfafa..cbdcc83e0a 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -120,7 +120,6 @@ videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) ////////////////////////////////////////////////////////////////////////////////// pdfQueue -.on('ready', () => undefined) .on('error', (err: Error) => undefined) .on('active', (job: Queue.Job, jobPromise: Queue.JobPromise) => jobPromise.cancel()) .on('active', (job: Queue.Job) => undefined) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index fcab3c282e..82a31a4ff3 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -207,6 +207,12 @@ declare namespace Bull { } interface Queue { + /** + * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. + * This replaces the `ready` event emitted on Queue in previous verisons. + */ + isReady(): Promise; + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -329,11 +335,6 @@ declare namespace Bull { */ on(event: string, callback: (...args: any[]) => void): this; - /** - * Redis is connected and the queue is ready to accept jobs - */ - on(event: 'ready', callback: EventCallback): this; - /** * An error occured */