diff options
Diffstat (limited to 'server/lib/activitypub/videos/updater.ts')
-rw-r--r-- | server/lib/activitypub/videos/updater.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/server/lib/activitypub/videos/updater.ts b/server/lib/activitypub/videos/updater.ts index 11c177a68..9e1c74969 100644 --- a/server/lib/activitypub/videos/updater.ts +++ b/server/lib/activitypub/videos/updater.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Transaction } from 'sequelize/types' | 1 | import { Transaction } from 'sequelize/types' |
2 | import { resetSequelizeInstance } from '@server/helpers/database-utils' | 2 | import { resetSequelizeInstance } from '@server/helpers/database-utils' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
4 | import { sequelizeTypescript } from '@server/initializers/database' | 4 | import { sequelizeTypescript } from '@server/initializers/database' |
5 | import { Notifier } from '@server/lib/notifier' | 5 | import { Notifier } from '@server/lib/notifier' |
6 | import { PeerTubeSocket } from '@server/lib/peertube-socket' | 6 | import { PeerTubeSocket } from '@server/lib/peertube-socket' |
@@ -19,6 +19,8 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
19 | 19 | ||
20 | private readonly oldVideoChannel: MChannelAccountLight | 20 | private readonly oldVideoChannel: MChannelAccountLight |
21 | 21 | ||
22 | protected lTags = loggerTagsFactory('ap', 'video', 'update') | ||
23 | |||
22 | constructor ( | 24 | constructor ( |
23 | protected readonly videoObject: VideoObject, | 25 | protected readonly videoObject: VideoObject, |
24 | private readonly video: MVideoAccountLightBlacklistAllFiles | 26 | private readonly video: MVideoAccountLightBlacklistAllFiles |
@@ -34,7 +36,10 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
34 | } | 36 | } |
35 | 37 | ||
36 | async update (overrideTo?: string[]) { | 38 | async update (overrideTo?: string[]) { |
37 | logger.debug('Updating remote video "%s".', this.videoObject.uuid, { videoObject: this.videoObject }) | 39 | logger.debug( |
40 | 'Updating remote video "%s".', this.videoObject.uuid, | ||
41 | { videoObject: this.videoObject, ...this.lTags(this.videoObject.uuid) } | ||
42 | ) | ||
38 | 43 | ||
39 | try { | 44 | try { |
40 | const channelActor = await this.getOrCreateVideoChannelFromVideoObject() | 45 | const channelActor = await this.getOrCreateVideoChannelFromVideoObject() |
@@ -77,7 +82,7 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
77 | PeerTubeSocket.Instance.sendVideoViewsUpdate(videoUpdated) | 82 | PeerTubeSocket.Instance.sendVideoViewsUpdate(videoUpdated) |
78 | } | 83 | } |
79 | 84 | ||
80 | logger.info('Remote video with uuid %s updated', this.videoObject.uuid) | 85 | logger.info('Remote video with uuid %s updated', this.videoObject.uuid, this.lTags(this.videoObject.uuid)) |
81 | 86 | ||
82 | return videoUpdated | 87 | return videoUpdated |
83 | } catch (err) { | 88 | } catch (err) { |
@@ -153,7 +158,7 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
153 | } | 158 | } |
154 | 159 | ||
155 | // This is just a debug because we will retry the insert | 160 | // This is just a debug because we will retry the insert |
156 | logger.debug('Cannot update the remote video.', { err }) | 161 | logger.debug('Cannot update the remote video.', { err, ...this.lTags(this.videoObject.uuid) }) |
157 | throw err | 162 | throw err |
158 | } | 163 | } |
159 | } | 164 | } |