Try not to reuse HTTP connections in CI, server shutting down is not

fatal
This commit is contained in:
Till Faelligen 2023-01-23 10:15:36 +01:00
parent 8b4bf1561b
commit f4d6704d95
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 6 additions and 0 deletions

View file

@ -70,6 +70,7 @@ func main() {
cfg.AppServiceAPI.DisableTLSValidation = true
cfg.ClientAPI.RateLimiting.Enabled = false
cfg.FederationAPI.DisableTLSValidation = false
cfg.FederationAPI.DisableHTTPKeepalives = true
// don't hit matrix.org when running tests!!!
cfg.FederationAPI.KeyPerspectives = config.KeyPerspectives{}
cfg.MediaAPI.BasePath = config.Path(filepath.Join(*dirPath, "media"))

View file

@ -77,6 +77,11 @@ func JetStreamConsumer(
// The consumer was deleted so stop.
return
} else {
// Unfortunately, there's no ErrServerShutdown or similar, so we need to compare the string
if err.Error() == "nats: Server Shutdown" {
logrus.WithContext(ctx).Warn("nats server shutting down")
return
}
// Something else went wrong, so we'll panic.
sentry.CaptureException(err)
logrus.WithContext(ctx).WithField("subject", subj).Fatal(err)