From a1460503cf061b31521667eeef595873c89d6f4f Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Tue, 30 Jan 2024 18:27:06 +0100 Subject: [PATCH] Make sure unresponsive split domain instances that come back to life don't get stuck isNotResponding --- .../backend/src/queue/processors/inbox.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/backend/src/queue/processors/inbox.ts b/packages/backend/src/queue/processors/inbox.ts index 1985edaac..6f3a98698 100644 --- a/packages/backend/src/queue/processors/inbox.ts +++ b/packages/backend/src/queue/processors/inbox.ts @@ -194,6 +194,27 @@ export default async (job: Bull.Job): Promise => { federationChart.inbox(i.host); }); + const inbox = authUser.user.sharedInbox ?? authUser.user.inbox; + if (inbox !== null) { + const { host: inboxHost } = new URL(inbox); + + if (inboxHost !== authUser.user.host) { + registerOrFetchInstanceDoc(inboxHost).then((i) => { + Instances.update(i.id, { + latestRequestReceivedAt: new Date(), + lastCommunicatedAt: new Date(), + isNotResponding: false, + }); + + fetchInstanceMetadata(i); + + instanceChart.requestReceived(i.host); + apRequestChart.inbox(); + federationChart.inbox(i.host); + }); + } + } + // アクティビティを処理 await perform(authUser.user, activity); return "ok";