mirror of https://github.com/Chocobozzz/PeerTube
Reduce error logs
parent
efa236c6c6
commit
941d28cc7f
|
@ -106,6 +106,8 @@ const jobTypes: JobType[] = [
|
||||||
'video-studio-edition'
|
'video-studio-edition'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const silentFailure = new Set<JobType>([ 'activitypub-http-unicast' ])
|
||||||
|
|
||||||
class JobQueue {
|
class JobQueue {
|
||||||
|
|
||||||
private static instance: JobQueue
|
private static instance: JobQueue
|
||||||
|
@ -152,7 +154,11 @@ class JobQueue {
|
||||||
.catch(err => logger.error('Error in job queue processor %s.', handlerName, { err }))
|
.catch(err => logger.error('Error in job queue processor %s.', handlerName, { err }))
|
||||||
|
|
||||||
queue.on('failed', (job, 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 => {
|
queue.on('error', err => {
|
||||||
|
|
|
@ -136,6 +136,7 @@ export class VideoViewerStats {
|
||||||
try {
|
try {
|
||||||
await sequelizeTypescript.transaction(async t => {
|
await sequelizeTypescript.transaction(async t => {
|
||||||
const video = await VideoModel.load(stats.videoId, t)
|
const video = await VideoModel.load(stats.videoId, t)
|
||||||
|
if (!video) return
|
||||||
|
|
||||||
const statsModel = await this.saveViewerStats(video, stats, t)
|
const statsModel = await this.saveViewerStats(video, stats, t)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue