This commit is contained in:
2022-09-10 22:01:48 +00:00
parent 56af1db7e7
commit 628364bcaa
8 changed files with 40 additions and 2 deletions

View File

@@ -232,6 +232,28 @@ namespace AyaNova.Util
private static TimeSpan CHECK_IF_DB_SERVER_AVAILABLE_DELAY = new TimeSpan(0, 0, 10);
///////////////////////////////////////////////////////////
// Check if exception means db server is unavailable
// if so, flag global flag indicating it isn't
//
internal static void HandleIfDatabaseUnavailableTypeException(Exception ex)
{
if (ex == null) return;
//System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
//System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
do
{
if (ex.Message.Contains("SOMESTRING"))
{
ServerGlobalOpsSettingsCache.DBAVAILABLE = true;
return;
}
ex = ex.InnerException;
//ServerGlobalOpsSettingsCache.DBAVAILABLE = true;
} while (ex != null);
}
///////////////////////////////////////////
//Verify that database exists, if not, then create it
//
@@ -514,7 +536,7 @@ namespace AyaNova.Util
await EraseTableAsync("apmitemoutsideservice", conn);
await EraseTableAsync("apmitem", conn);
await EraseTableAsync("apm", conn);//bugbug
//---
//---
await EraseTableAsync("afileattachment", conn);
await EraseTableAsync("aevent", conn);