From da6a0930db1288cee0a2f9cb1dbd0246ca5c2c57 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Fri, 27 Dec 2024 18:44:59 +0900 Subject: [PATCH] =?UTF-8?q?chore(backend):=20=E3=83=8E=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=8F=97=E4=BF=A1=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AB?= =?UTF-8?q?=E9=81=85=E5=BB=B6=E6=99=82=E9=96=93=E3=82=92=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/activitypub/ApInboxService.ts | 5 +++++ .../backend/src/core/activitypub/models/ApNoteService.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts index b68f2e394954..c4a62a8ec98d 100644 --- a/packages/backend/src/core/activitypub/ApInboxService.ts +++ b/packages/backend/src/core/activitypub/ApInboxService.ts @@ -351,6 +351,11 @@ export class ApInboxService { return 'skip: malformed createdAt'; } + if (createdAt) { + const delay = Date.now() - createdAt.getTime(); + this.logger.info(`Note Received delay: ${delay}ms, host: ${actor.host}`); + } + await this.noteCreateService.create(actor, { createdAt, renote, diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 427babea6011..b337c9924c08 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -316,6 +316,12 @@ export class ApNoteService { const apEmojis = emojis.map(emoji => emoji.name); + const createdAt = note.published ? new Date(note.published) : null; + if (createdAt) { + const delay = Date.now() - createdAt.getTime(); + this.logger.info(`Note Received delay: ${delay}ms, host: ${actor.host}`); + } + try { return await this.noteCreateService.create(actor, { createdAt: note.published ? new Date(note.published) : null,