merge: parse notRespondingSince from redis instance cache (!560)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/560

Approved-by: Tess K <me@thvxl.se>
Approved-by: Marie <marie@kaifa.ch>
This commit is contained in:
dakkar 2024-06-25 13:10:48 +00:00
commit 348366fa7d
3 changed files with 8 additions and 1 deletions

View file

@ -8,7 +8,7 @@
### Server
- チャート生成時にinstance.suspentionStateに置き換えられたinstance.isSuspendedが参照されてしまう問題を修正
- Fix: notRespondingSinceが実装される前に不通になったインスタンスが自動的に配信停止にならない (#14059)
## 2024.5.0

View file

@ -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,
};
},
});

View file

@ -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();