From 3c3485e8a8ab144cd0917459146cf5e1868dabb7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 23 Jun 2024 10:57:05 +0100 Subject: [PATCH 1/2] parse `notRespondingSince` from redis instance cache if we don't do this, we'll get a string, and `DeliverProcessorService` will error out `i.notRespondingSince.getTime is not a function` --- packages/backend/src/core/FederatedInstanceService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/core/FederatedInstanceService.ts b/packages/backend/src/core/FederatedInstanceService.ts index 66db2067d9..e73e1d3a9d 100644 --- a/packages/backend/src/core/FederatedInstanceService.ts +++ b/packages/backend/src/core/FederatedInstanceService.ts @@ -40,6 +40,7 @@ export class FederatedInstanceService implements OnApplicationShutdown { firstRetrievedAt: new Date(parsed.firstRetrievedAt), latestRequestReceivedAt: parsed.latestRequestReceivedAt ? new Date(parsed.latestRequestReceivedAt) : null, infoUpdatedAt: parsed.infoUpdatedAt ? new Date(parsed.infoUpdatedAt) : null, + notRespondingSince: parsed.notRespondingSince ? new Date(parsed.notRespondingSince) : null, }; }, }); From 0e5a52c6789b2f23dc17f2c18489e706b3fae3a9 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 22 Jun 2024 12:44:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20notRespondingSince=E3=81=8C=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E3=81=95=E3=82=8C=E3=82=8B=E5=89=8D=E3=81=AB=E4=B8=8D?= =?UTF-8?q?=E9=80=9A=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E3=81=8C=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E7=9A=84=E3=81=AB=E9=85=8D=E4=BF=A1=E5=81=9C=E6=AD=A2=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=89=E3=81=AA=E3=81=84=20(#14059)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- CHANGELOG.md | 2 +- .../backend/src/queue/processors/DeliverProcessorService.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f93811c606..e2528594c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ### Server - チャート生成時にinstance.suspentionStateに置き換えられたinstance.isSuspendedが参照されてしまう問題を修正 - +- Fix: notRespondingSinceが実装される前に不通になったインスタンスが自動的に配信停止にならない (#14059) ## 2024.5.0 diff --git a/packages/backend/src/queue/processors/DeliverProcessorService.ts b/packages/backend/src/queue/processors/DeliverProcessorService.ts index b73195afc3..d665945861 100644 --- a/packages/backend/src/queue/processors/DeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/DeliverProcessorService.ts @@ -109,6 +109,12 @@ export class DeliverProcessorService { suspensionState: 'autoSuspendedForNotResponding', }); } + } else { + // isNotRespondingがtrueでnotRespondingSinceがnullの場合はnotRespondingSinceをセット + // notRespondingSinceは新たな機能なので、それ以前のデータにはnotRespondingSinceがない場合がある + this.federatedInstanceService.update(i.id, { + notRespondingSince: new Date(), + }); } this.apRequestChart.deliverFail();