Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Reduce error logs

Chocobozzz941d28cc7f98
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts
index 167b7b168d..d3776c3bfd 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<JobType>([ '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 fd66fd5c7e..a9ba25b475 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)