From 8ae30e8f89ea9604755aad7c0624fdc99e8f48ba Mon Sep 17 00:00:00 2001 From: Patrick Chatain Date: Sun, 3 Feb 2019 14:32:30 +0100 Subject: [PATCH] add toJson job method --- types/bull/index.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index bbafa0301c..36f05a7058 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -228,6 +228,25 @@ declare namespace Bull { * Takes a lock for this job so that no other queue worker can process it at the same time. */ takeLock(): Promise; + + /** + * Get job properties as Json Object + */ + toJSON(): { + id: JobId, + name: string, + data: T, + opts: JobOptions, + progress: number, + delay: number, + timestamp: number, + attemptsMade: number, + failedReason: string, + stacktrace: string[] | null, + returnvalue: any, + finishedOn: number | null, + processedOn: number | null + }; } type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed';