From: Chocobozzz Date: Wed, 18 May 2022 10:01:02 +0000 (+0200) Subject: Reduce error logs X-Git-Tag: v4.2.0-rc.1~33 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=941d28cc7f9877aa2cfcee018413e0f04f0a9048;p=github%2FChocobozzz%2FPeerTube.git Reduce error logs --- 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[] = [ 'video-studio-edition' ] +const silentFailure = new Set([ 'activitypub-http-unicast' ]) + class JobQueue { private static instance: JobQueue @@ -152,7 +154,11 @@ class JobQueue { .catch(err => logger.error('Error in job queue processor %s.', handlerName, { err })) queue.on('failed', (job, err) => { - logger.error('Cannot execute job %d in queue %s.', job.id, handlerName, { payload: job.data, err }) + const logLevel = silentFailure.has(handlerName) + ? 'debug' + : 'error' + + logger.log(logLevel, 'Cannot execute job %d in queue %s.', job.id, handlerName, { payload: job.data, err }) }) queue.on('error', err => { diff --git a/server/lib/views/shared/video-viewer-stats.ts b/server/lib/views/shared/video-viewer-stats.ts index fd66fd5c7..a9ba25b47 100644 --- a/server/lib/views/shared/video-viewer-stats.ts +++ b/server/lib/views/shared/video-viewer-stats.ts @@ -136,6 +136,7 @@ export class VideoViewerStats { try { await sequelizeTypescript.transaction(async t => { const video = await VideoModel.load(stats.videoId, t) + if (!video) return const statsModel = await this.saveViewerStats(video, stats, t)