diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-07 18:26:12 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-07 18:26:12 +0200 |
commit | ad0997adfb9e1e3b1ff54338d7558cf7b18440ea (patch) | |
tree | 78ef53699d260e194bbcda7eccb645a14070679a /server/lib/jobs | |
parent | 709756b8e183f67ef9bf8f7bc149af4736260350 (diff) | |
download | PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.tar.gz PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.tar.zst PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.zip |
Fix error logging
Diffstat (limited to 'server/lib/jobs')
-rw-r--r-- | server/lib/jobs/handlers/video-transcoder.ts | 2 | ||||
-rw-r--r-- | server/lib/jobs/job-scheduler.ts | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/jobs/handlers/video-transcoder.ts b/server/lib/jobs/handlers/video-transcoder.ts index e829ca813..eeb2d57b0 100644 --- a/server/lib/jobs/handlers/video-transcoder.ts +++ b/server/lib/jobs/handlers/video-transcoder.ts | |||
@@ -10,7 +10,7 @@ function process (data: { id: string }) { | |||
10 | } | 10 | } |
11 | 11 | ||
12 | function onError (err: Error, jobId: number) { | 12 | function onError (err: Error, jobId: number) { |
13 | logger.error('Error when transcoding video file in job %d.', jobId, { error: err }) | 13 | logger.error('Error when transcoding video file in job %d.', jobId, err) |
14 | return Promise.resolve() | 14 | return Promise.resolve() |
15 | } | 15 | } |
16 | 16 | ||
diff --git a/server/lib/jobs/job-scheduler.ts b/server/lib/jobs/job-scheduler.ts index 248dc7978..2ae732b0f 100644 --- a/server/lib/jobs/job-scheduler.ts +++ b/server/lib/jobs/job-scheduler.ts | |||
@@ -51,13 +51,13 @@ class JobScheduler { | |||
51 | // Optimization: we could use "drain" from queue object | 51 | // Optimization: we could use "drain" from queue object |
52 | return setTimeout(next, JOBS_FETCHING_INTERVAL) | 52 | return setTimeout(next, JOBS_FETCHING_INTERVAL) |
53 | }) | 53 | }) |
54 | .catch(err => logger.error('Cannot list pending jobs.', { error: err })) | 54 | .catch(err => logger.error('Cannot list pending jobs.', err)) |
55 | }, | 55 | }, |
56 | 56 | ||
57 | err => logger.error('Error in job scheduler queue.', { error: err }) | 57 | err => logger.error('Error in job scheduler queue.', err) |
58 | ) | 58 | ) |
59 | }) | 59 | }) |
60 | .catch(err => logger.error('Cannot list pending jobs.', { error: err })) | 60 | .catch(err => logger.error('Cannot list pending jobs.', err)) |
61 | } | 61 | } |
62 | 62 | ||
63 | createJob (transaction: Sequelize.Transaction, handlerName: string, handlerInputData: object) { | 63 | createJob (transaction: Sequelize.Transaction, handlerName: string, handlerInputData: object) { |
@@ -95,7 +95,7 @@ class JobScheduler { | |||
95 | }, | 95 | }, |
96 | 96 | ||
97 | err => { | 97 | err => { |
98 | logger.error('Error in job handler %s.', job.handlerName, { error: err }) | 98 | logger.error('Error in job handler %s.', job.handlerName, err) |
99 | return this.onJobError(jobHandler, job, err) | 99 | return this.onJobError(jobHandler, job, err) |
100 | } | 100 | } |
101 | ) | 101 | ) |
@@ -123,7 +123,7 @@ class JobScheduler { | |||
123 | } | 123 | } |
124 | 124 | ||
125 | private cannotSaveJobError (err: Error) { | 125 | private cannotSaveJobError (err: Error) { |
126 | logger.error('Cannot save new job state.', { error: err }) | 126 | logger.error('Cannot save new job state.', err) |
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||