diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-18 12:01:02 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-18 12:01:02 +0200 |
commit | 941d28cc7f9877aa2cfcee018413e0f04f0a9048 (patch) | |
tree | 59f889a5a782713aa2060f4beffc6b0cfd671b96 /server/lib/job-queue | |
parent | efa236c6c674835c3f64731d2ba6ad0e82a79e27 (diff) | |
download | PeerTube-941d28cc7f9877aa2cfcee018413e0f04f0a9048.tar.gz PeerTube-941d28cc7f9877aa2cfcee018413e0f04f0a9048.tar.zst PeerTube-941d28cc7f9877aa2cfcee018413e0f04f0a9048.zip |
Reduce error logs
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index 167b7b168..d3776c3bf 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -106,6 +106,8 @@ const jobTypes: JobType[] = [ | |||
106 | 'video-studio-edition' | 106 | 'video-studio-edition' |
107 | ] | 107 | ] |
108 | 108 | ||
109 | const silentFailure = new Set<JobType>([ 'activitypub-http-unicast' ]) | ||
110 | |||
109 | class JobQueue { | 111 | class JobQueue { |
110 | 112 | ||
111 | private static instance: JobQueue | 113 | private static instance: JobQueue |
@@ -152,7 +154,11 @@ class JobQueue { | |||
152 | .catch(err => logger.error('Error in job queue processor %s.', handlerName, { err })) | 154 | .catch(err => logger.error('Error in job queue processor %s.', handlerName, { err })) |
153 | 155 | ||
154 | queue.on('failed', (job, err) => { | 156 | queue.on('failed', (job, err) => { |
155 | logger.error('Cannot execute job %d in queue %s.', job.id, handlerName, { payload: job.data, err }) | 157 | const logLevel = silentFailure.has(handlerName) |
158 | ? 'debug' | ||
159 | : 'error' | ||
160 | |||
161 | logger.log(logLevel, 'Cannot execute job %d in queue %s.', job.id, handlerName, { payload: job.data, err }) | ||
156 | }) | 162 | }) |
157 | 163 | ||
158 | queue.on('error', err => { | 164 | queue.on('error', err => { |