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 */