diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 2314b06546..cd733a6482 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -165,6 +165,11 @@ videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) // error }); +pdfQueue.whenCurrentJobsFinished() +.then(() => { + // Jobs finished +}); + ////////////////////////////////////////////////////////////////////////////////// // // Typed Event Handlers diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index eb2a5b3f08..98315611d6 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bull 3.10 +// Type definitions for bull 3.12 // Project: https://github.com/OptimalBits/bull // Definitions by: Bruno Grieder // Cameron Crothers @@ -17,6 +17,7 @@ // DoYoung Ha // Borys Kupar // Remko Klein +// Levi Bostian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -846,6 +847,11 @@ declare namespace Bull { * @param list String with all redis clients */ parseClientList(list: string): Redis.Redis[]; + + /** + * Returns a promise that resolves when active jobs are finished + */ + whenCurrentJobsFinished(): Promise; } type EventCallback = () => void;