mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Ignore database shutting down errors
This commit is contained in:
parent
8b55e1364d
commit
0f8786143f
1 changed files with 5 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ using System.Threading.Tasks;
|
|||
|
||||
using Discord.Net;
|
||||
|
||||
using Npgsql;
|
||||
|
||||
using PluralKit.Core;
|
||||
|
||||
namespace PluralKit.Bot
|
||||
|
|
@ -32,6 +34,9 @@ namespace PluralKit.Bot
|
|||
// Sometimes Discord just times everything out.
|
||||
if (e is TimeoutException) return false;
|
||||
|
||||
// Ignore "Database is shutting down" error
|
||||
if (e is PostgresException pe && pe.SqlState == "57P03") return false;
|
||||
|
||||
// This may expanded at some point.
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue