This commit is contained in:
@@ -40,6 +40,10 @@ Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
|
|||||||
System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
|
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.
|
System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
||||||
|
|
||||||
|
ex.source "Npgsql.EntityFrameworkCore.PostgreSQL","Npgsql"
|
||||||
|
ex.message "An exception has been raised that is likely due to a transient failure.","Exception while writing to stream","Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.."
|
||||||
|
|
||||||
|
|
||||||
Boot exception when db is not up:
|
Boot exception when db is not up:
|
||||||
{Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
|
{Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
|
||||||
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
||||||
|
|||||||
@@ -239,21 +239,11 @@ namespace AyaNova.Util
|
|||||||
internal static void HandleIfDatabaseUnavailableTypeException(Exception ex)
|
internal static void HandleIfDatabaseUnavailableTypeException(Exception ex)
|
||||||
{
|
{
|
||||||
if (ex == null) return;
|
if (ex == null) return;
|
||||||
//System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
|
if (ex.Message.Contains("transient failure") && ex.Source.Contains("PostgreSQL"))
|
||||||
//System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
ServerGlobalOpsSettingsCache.DBAVAILABLE = false;
|
||||||
|
|
||||||
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
|
//Verify that database exists, if not, then create it
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user