From e5c74edd853ff11b4d353dc85aa277bfff6e33dc Mon Sep 17 00:00:00 2001 From: spiral Date: Tue, 9 Nov 2021 01:31:42 -0500 Subject: [PATCH] feat: ignore database timing out --- PluralKit.Bot/Utils/MiscUtils.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PluralKit.Bot/Utils/MiscUtils.cs b/PluralKit.Bot/Utils/MiscUtils.cs index 060531ac..5b371544 100644 --- a/PluralKit.Bot/Utils/MiscUtils.cs +++ b/PluralKit.Bot/Utils/MiscUtils.cs @@ -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;