This commit is contained in:
2021-08-05 23:39:45 +00:00
parent 49bd0d2d87
commit 1797263d06
5 changed files with 42 additions and 40 deletions

View File

@@ -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();

View File

@@ -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)
{

View File

@@ -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);