diff options
Diffstat (limited to 'server/lib/jobs/job-scheduler.ts')
-rw-r--r-- | server/lib/jobs/job-scheduler.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/jobs/job-scheduler.ts b/server/lib/jobs/job-scheduler.ts index b25bb7ab3..73c440279 100644 --- a/server/lib/jobs/job-scheduler.ts +++ b/server/lib/jobs/job-scheduler.ts | |||
@@ -9,7 +9,7 @@ import { error } from 'util' | |||
9 | export interface JobHandler<P, T> { | 9 | export interface JobHandler<P, T> { |
10 | process (data: object, jobId: number): Promise<T> | 10 | process (data: object, jobId: number): Promise<T> |
11 | onError (err: Error, jobId: number) | 11 | onError (err: Error, jobId: number) |
12 | onSuccess (jobId: number, jobResult: T, jobScheduler: JobScheduler<P, T>) | 12 | onSuccess (jobId: number, jobResult: T, jobScheduler: JobScheduler<P, T>): Promise<any> |
13 | } | 13 | } |
14 | type JobQueueCallback = (err: Error) => void | 14 | type JobQueueCallback = (err: Error) => void |
15 | 15 | ||
@@ -127,7 +127,7 @@ class JobScheduler<P, T> { | |||
127 | 127 | ||
128 | try { | 128 | try { |
129 | await job.save() | 129 | await job.save() |
130 | jobHandler.onSuccess(job.id, jobResult, this) | 130 | await jobHandler.onSuccess(job.id, jobResult, this) |
131 | } catch (err) { | 131 | } catch (err) { |
132 | this.cannotSaveJobError(err) | 132 | this.cannotSaveJobError(err) |
133 | } | 133 | } |