From ca108813b7fbda45d2f3df985cd8683193f6ba33 Mon Sep 17 00:00:00 2001 From: spiral Date: Sat, 19 Mar 2022 21:57:58 -0400 Subject: [PATCH] fix: don't spam errors when postgres is restarting --- PluralKit.Bot/Utils/MiscUtils.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/Utils/MiscUtils.cs b/PluralKit.Bot/Utils/MiscUtils.cs index ffde12d9..be132184 100644 --- a/PluralKit.Bot/Utils/MiscUtils.cs +++ b/PluralKit.Bot/Utils/MiscUtils.cs @@ -59,6 +59,9 @@ public static class MiscUtils // Ignore "Database is shutting down" error if (e is PostgresException pe && pe.SqlState == "57P03") return false; + // Ignore *other* "database is shutting down" error (57P01) + if (e is PostgresException pe2 && pe2.SqlState == "57P01") return false; + // Ignore database timing out as well. if (e is NpgsqlException tpe && tpe.InnerException is TimeoutException) return false;