diff --git a/.vscode/launch.json b/.vscode/launch.json index b77f3b95..fcc80a75 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,7 +53,7 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "false", + "AYANOVA_SERVER_TEST_MODE": "true", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" diff --git a/devdocs/deploy.txt b/devdocs/deploy.txt index 60099235..5cf7efcf 100644 --- a/devdocs/deploy.txt +++ b/devdocs/deploy.txt @@ -5,6 +5,10 @@ PUBLISH TO DEVOPS STEPS +FIRST +=-=-=- +***** BEFORE RELEASE DOUBLE CHECK CAN RE-SEED FROM CLIENT UI AS THERE IS OFTEN ISSUES WITH DBUTIL ERASE TABLES AND THE ORDERING ETC ****** + CLIENT =-=-=-= - TURN OFF DEV MODE IN MAIN.JS diff --git a/server/AyaNova/biz/JobsBiz.cs b/server/AyaNova/biz/JobsBiz.cs index 54e61e11..a5b7a230 100644 --- a/server/AyaNova/biz/JobsBiz.cs +++ b/server/AyaNova/biz/JobsBiz.cs @@ -186,19 +186,12 @@ namespace AyaNova.Biz //system lock (no license) is a complete deal breaker for continuation beyond here if (serverState.IsSystemLocked) return; - //Moved the following user count checker to within JOB SWEEPER so that it only checks on every half hour so it's less obvious in logs with full trace on and - //also so someone fucking with the system won't get locked out right away. - //"SHENANIGAN" CHECK, note, must be here after systemlock because it relies on there being a license - // if (await UserBiz.ActiveCountAsync() > AyaNova.Core.License.ActiveKey.ActiveNumber) - // { - // var msg = $"E1020 - Active count exceeded capacity"; - // ServiceProviderProvider.ServerState.SetSystemLock(msg); - // log.LogCritical(msg); - // return; - // } - log.LogDebug("Processing semi-critical internal jobs"); +#if (DEBUG) + log.LogInformation("Processing semi-critical internal jobs (backup, pm, notification etc)"); +#endif + //BACKUP await CoreJobBackup.DoWorkAsync(); diff --git a/server/AyaNova/generator/Generate.cs b/server/AyaNova/generator/Generate.cs index cbfeb6b6..f2ea8840 100644 --- a/server/AyaNova/generator/Generate.cs +++ b/server/AyaNova/generator/Generate.cs @@ -34,11 +34,6 @@ namespace AyaNova.Generator log = logger; } - /* - todo: improve this - it should timeout: https://stackoverflow.com/questions/23476576/cancellationtoken-timeout-vs-task-delay-and-timeout - it should never stop running no matter what unless the server shuts down - */ protected override async Task ExecuteAsync(CancellationToken stoppingToken) { diff --git a/server/AyaNova/util/DbUtil.cs b/server/AyaNova/util/DbUtil.cs index fd51ab46..b9890186 100644 --- a/server/AyaNova/util/DbUtil.cs +++ b/server/AyaNova/util/DbUtil.cs @@ -363,6 +363,35 @@ namespace AyaNova.Util await EraseTableAsync("aworkorder", conn); //--- + //--- QUOTE + await EraseTableAsync("aquoteitemexpense", conn); + await EraseTableAsync("aquoteitemlabor", conn); + await EraseTableAsync("aquoteitemloan", conn); + await EraseTableAsync("aquoteitempart", conn); + await EraseTableAsync("aquoteitemscheduleduser", conn); + await EraseTableAsync("aquoteitemtask", conn); + await EraseTableAsync("aquoteitemtravel", conn); + await EraseTableAsync("aquoteitemunit", conn); + await EraseTableAsync("aquoteitemoutsideservice", conn); + await EraseTableAsync("aquoteitem", conn); + await EraseTableAsync("aquotestate", conn); + await EraseTableAsync("aquote", conn); + //--- + + + //--- PM + await EraseTableAsync("apmitemexpense", conn); + await EraseTableAsync("apmitemlabor", conn); + await EraseTableAsync("apmitemloan", conn); + await EraseTableAsync("apmitempart", conn); + await EraseTableAsync("apmitemscheduleduser", conn); + await EraseTableAsync("apmitemtask", conn); + await EraseTableAsync("apmitemtravel", conn); + await EraseTableAsync("apmitemunit", conn); + await EraseTableAsync("apmitemoutsideservice", conn); + await EraseTableAsync("apmitem", conn); + await EraseTableAsync("apm", conn); + //--- await EraseTableAsync("afileattachment", conn); await EraseTableAsync("acustomerservicerequest", conn); @@ -380,7 +409,7 @@ namespace AyaNova.Util - await EraseTableAsync("aloanunit", conn); + await EraseTableAsync("apartassemblyitem", conn); await EraseTableAsync("apartassembly", conn); await EraseTableAsync("apartinventory", conn); @@ -388,29 +417,9 @@ namespace AyaNova.Util - //--- QUOTE - await EraseTableAsync("aquoteitemexpense", conn); - await EraseTableAsync("aquoteitemlabor", conn); - await EraseTableAsync("aquoteitemloan", conn); - await EraseTableAsync("aquoteitempart", conn); - await EraseTableAsync("aquoteitemscheduleduser", conn); - await EraseTableAsync("aquoteitemtask", conn); - await EraseTableAsync("aquoteitemtravel", conn); - await EraseTableAsync("aquoteitemunit", conn); - await EraseTableAsync("aquoteitemoutsideservice", conn); - await EraseTableAsync("aquoteitem", conn); - await EraseTableAsync("aquotestate", conn); - await EraseTableAsync("aquote", conn); - //--- - - - await EraseTableAsync("apmitem", conn); - await EraseTableAsync("apm", conn); - - - + await EraseTableAsync("aloanunit", conn); await EraseTableAsync("aunitmodel", conn); await EraseTableAsync("avendor", conn); @@ -436,8 +445,9 @@ namespace AyaNova.Util await EraseTableAsync("aservicerate", conn); await EraseTableAsync("atravelrate", conn); await EraseTableAsync("ataxcode", conn); - //await EraseTableAsync("aservicebank", conn); + + await EraseTableAsync("aquotestatus", conn); await EraseTableAsync("aworkorderstatus", conn); await EraseTableAsync("aworkorderitemstatus", conn); await EraseTableAsync("aworkorderitempriority", conn);