diff --git a/.vscode/launch.json b/.vscode/launch.json index b4e9329..3300e7e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -35,7 +35,7 @@ "SOCKEYE_DB_CONNECTION": "Server=localhost;Username=postgres;Password=sockeye;Database=sockeye;CommandTimeout=300;", "SOCKEYE_DATA_PATH": "c:\\temp\\sockeye", "SOCKEYE_USE_URLS": "http://*:7676;", - //"SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true", + "SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true", //"SOCKEYE_REMOVE_LICENSE_FROM_DB":"true", //"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1", "SOCKEYE_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin" diff --git a/server/Startup.cs b/server/Startup.cs index 24f96bb..47c4942 100644 --- a/server/Startup.cs +++ b/server/Startup.cs @@ -663,9 +663,13 @@ namespace Sockeye Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); - - GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(dbContext); - biz.ImportRockfish(dbContext, _newLog).Wait(); + if (ServerBootConfig.SOCKEYE_PERMANENTLY_ERASE_DATABASE) + { + _newLog.LogWarning("SOCKEYE_PERMANENTLY_ERASE_DATABASE has been set - IMPORTING ROCKFISH"); + GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(dbContext); + biz.ImportRockfish(dbContext, _newLog).Wait(); + _newLog.LogInformation("IMPORT COMPLETED"); + } }