Allow clearing federation blacklist at startup for P2P demos

This commit is contained in:
Neil Alexander 2021-05-24 11:43:24 +01:00
parent d2d2164025
commit 79c5485c8d
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
15 changed files with 60 additions and 30 deletions

View file

@ -43,6 +43,7 @@ func NewInternalAPI(
federation *gomatrixserverlib.FederationClient,
rsAPI roomserverAPI.RoomserverInternalAPI,
keyRing *gomatrixserverlib.KeyRing,
resetBlacklist bool,
) api.FederationSenderInternalAPI {
cfg := &base.Cfg.FederationSender
@ -51,6 +52,10 @@ func NewInternalAPI(
logrus.WithError(err).Panic("failed to connect to federation sender db")
}
if resetBlacklist {
_ = federationSenderDB.RemoveAllServersFromBlacklist()
}
stats := &statistics.Statistics{
DB: federationSenderDB,
FailuresUntilBlacklist: cfg.FederationMaxRetries,