case 4396
This commit is contained in:
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -118,8 +118,8 @@
|
|||||||
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=300;",
|
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=300;",
|
||||||
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
|
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
|
||||||
"AYANOVA_USE_URLS": "http://*:7575;",
|
"AYANOVA_USE_URLS": "http://*:7575;",
|
||||||
//"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
|
"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
|
||||||
// "AYANOVA_REMOVE_LICENSE_FROM_DB":"true",
|
"AYANOVA_REMOVE_LICENSE_FROM_DB":"true",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"
|
||||||
},
|
},
|
||||||
"sourceFileMap": {
|
"sourceFileMap": {
|
||||||
|
|||||||
@@ -405,16 +405,14 @@ namespace AyaNova.Util
|
|||||||
//- select the superuser account back to the auser and useroptions
|
//- select the superuser account back to the auser and useroptions
|
||||||
//- discover where else this needs to be done
|
//- discover where else this needs to be done
|
||||||
//- $profit
|
//- $profit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_log.LogInformation("Erasing Database \"{0}\"", _dbName);
|
_log.LogInformation("Erasing Database \"{0}\"", _dbName);
|
||||||
AyaNova.Api.ControllerHelpers.ApiServerState apiServerState = (AyaNova.Api.ControllerHelpers.ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(AyaNova.Api.ControllerHelpers.ApiServerState));
|
AyaNova.Api.ControllerHelpers.ApiServerState apiServerState = (AyaNova.Api.ControllerHelpers.ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(AyaNova.Api.ControllerHelpers.ApiServerState));
|
||||||
|
|
||||||
apiServerState.SetClosed("Erasing database");
|
apiServerState.SetClosed("Erasing database");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
//clear all connections so that the database can be dropped
|
//clear all connections so that the database can be dropped
|
||||||
Npgsql.NpgsqlConnection.ClearAllPools();
|
Npgsql.NpgsqlConnection.ClearAllPools();
|
||||||
|
|
||||||
@@ -693,11 +691,18 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
_log.LogInformation("Importing any missing stock Report templates");
|
_log.LogInformation("Importing any missing stock Report templates");
|
||||||
await AyaNova.Biz.PrimeData.PrimeReportTemplates();
|
await AyaNova.Biz.PrimeData.PrimeReportTemplates();
|
||||||
|
|
||||||
apiServerState.ResumePriorState();
|
apiServerState.ResumePriorState();
|
||||||
|
|
||||||
_log.LogInformation("Database erase completed");
|
_log.LogInformation("Database erase completed");
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//NOTE: deliberately leaving server in CLOSED state so users see that there is a problem
|
||||||
|
//and investigate
|
||||||
|
_log.LogCritical(ex, "Unable to erase database due to unexpected condition. Please contact technical support to resolve.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user