From 633a7080319332181cd5bbd6c4ec6927dee6726c Mon Sep 17 00:00:00 2001 From: Doug Ayers <4142577+douglascayers@users.noreply.github.com> Date: Tue, 5 Nov 2019 15:35:06 -0600 Subject: [PATCH] Add getter signature to job.progress function (#40097) --- types/bull/bull-tests.tsx | 6 ++++++ types/bull/index.d.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 916e8fe69a..2314b06546 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -31,6 +31,9 @@ videoQueue.process((job, done) => { // transcode video asynchronously and report progress job.progress(42); + // get current job progress + const progress = job.progress(); + job.log('loglog'); job.isCompleted(); job.isFailed(); @@ -60,6 +63,9 @@ audioQueue.process((job, done) => { // transcode audio asynchronously and report progress job.progress(42); + // get current job progress + const progress = job.progress(); + // call done when finished done(); diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 0bdf77bf92..eb2a5b3f08 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -170,6 +170,11 @@ declare namespace Bull { returnvalue: any; + /** + * Get progress on a job + */ + progress(): any; + /** * Report progress on a job */