ActivityPub-federated video streaming platform using P2P directly in your web browser
Add more context logger
Chocobozzz4a5a4ef65694
diff --git a/server/core/lib/activitypub/videos/shared/video-sync-attributes.ts b/server/core/lib/activitypub/videos/shared/video-sync-attributes.tsindex 6e71c87975..9a1789edb2 100644--- a/server/core/lib/activitypub/videos/shared/video-sync-attributes.ts+++ b/server/core/lib/activitypub/videos/shared/video-sync-attributes.ts@@ -20,19 +20,21 @@ export type SyncParam = {refreshVideo?: boolean}-export async function syncVideoExternalAttributes (+export function syncVideoExternalAttributes (video: MVideo,fetchedVideo: VideoObject,syncParam: Pick<SyncParam, 'rates' | 'shares' | 'comments'>) {- logger.info('Adding likes/dislikes/shares/comments of video %s.', video.uuid)+ return logger.withContext([ video.uuid, video.url ], async () => {+ logger.info('Adding likes/dislikes/shares/comments of video %s.', video.uuid)- const ratePromise = updateVideoRates(video, fetchedVideo)- if (syncParam.rates) await ratePromise+ const ratePromise = updateVideoRates(video, fetchedVideo)+ if (syncParam.rates) await ratePromise- await syncShares(video, fetchedVideo, syncParam.shares)+ await syncShares(video, fetchedVideo, syncParam.shares)- await syncComments(video, fetchedVideo, syncParam.comments)+ await syncComments(video, fetchedVideo, syncParam.comments)+ })}export async function updateVideoRates (video: MVideo, fetchedVideo: VideoObject) {diff --git a/server/core/lib/job-queue/handlers/activitypub-http-fetcher.ts b/server/core/lib/job-queue/handlers/activitypub-http-fetcher.tsindex 151dd8bb96..b86cd18712 100644--- a/server/core/lib/job-queue/handlers/activitypub-http-fetcher.ts+++ b/server/core/lib/job-queue/handlers/activitypub-http-fetcher.ts@@ -25,6 +25,8 @@ async function processActivityPubHttpFetcher (job: Job) {let account: MAccountDefaultif (payload.accountId) account = await AccountModel.load(payload.accountId)+ const context = [ video?.url, video?.uuid, account?.Actor.url ].filter(Boolean)+const fetcherType: { [id in FetchType]: (items: any[]) => Promise<any> } = {'activity': items => processActivities(items, { outboxUrl: payload.uri, fromFetch: true }),'video-shares': items => logger.withContext([ video.uuid ], () => addVideoShares(items, video)),@@ -37,7 +39,9 @@ async function processActivityPubHttpFetcher (job: Job) {'video-comments': crawlStartDate => VideoCommentModel.cleanOldCommentsOf(video.id, crawlStartDate)}- return crawlCollectionPage(payload.uri, fetcherType[payload.type], cleanerType[payload.type], payload.abortSignal)+ return logger.withContext(context, () => {+ return crawlCollectionPage(payload.uri, fetcherType[payload.type], cleanerType[payload.type], payload.abortSignal)+ })}// ---------------------------------------------------------------------------