feat: ignore database timing out

This commit is contained in:
spiral 2021-11-09 01:31:42 -05:00
parent b4e8dda9dd
commit e5c74edd85
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -62,6 +62,10 @@ namespace PluralKit.Bot
// Ignore "Database is shutting down" error
if (e is PostgresException pe && pe.SqlState == "57P03") return false;
// Ignore database timing out as well.
if (e is NpgsqlException tpe && tpe.InnerException is TimeoutException)
return false;
// Ignore thread pool exhaustion errors
if (e is NpgsqlException npe && npe.Message.Contains("The connection pool has been exhausted")) return false;