diff --git a/src/model/JobQueue.ts b/src/model/JobQueue.ts index 864c526..665ac83 100644 --- a/src/model/JobQueue.ts +++ b/src/model/JobQueue.ts @@ -114,6 +114,9 @@ export class JobQueue { } public async getJob(id: string): Promise { + if (!this.initialized) { + await this.init(); + } return >this.queue.getJob(id); } @@ -126,6 +129,9 @@ export class JobQueue { // WARNING: using private methods from bull! public async stats() { + if (!this.initialized) { + await this.init(); + } let promises: Promise[] = []; return new Promise((fulfill, reject) => { promises.push(this.queue.getCompletedCount());