From bdc923330df2822ae89150352e687ceb009bee63 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 27 Aug 2021 19:16:12 +0000 Subject: [PATCH] --- .vscode/launch.json | 4 ++-- server/AyaNova/AyaNova.csproj | 32 ++++++++++++++++---------------- server/AyaNova/biz/PMBiz.cs | 5 ++++- server/AyaNova/util/DbUtil.cs | 2 +- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ed2bc750..b77f3b95 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -42,8 +42,8 @@ "ASPNETCORE_ENVIRONMENT": "Development", "AYANOVA_JWT_SECRET": "UNLICENSED5G*QQJ8#bQ7$Xr_@sXfHq4", //"AYANOVA_SET_SUPERUSER_PW": "l3tm3in", - //"AYANOVA_LOG_LEVEL": "Info", - "AYANOVA_LOG_LEVEL": "Debug", + "AYANOVA_LOG_LEVEL": "Info", + // "AYANOVA_LOG_LEVEL": "Debug", // "AYANOVA_LOG_LEVEL": "Trace", "AYANOVA_DEFAULT_TRANSLATION": "en", //TRANSLATION MUST BE en for Integration TESTING diff --git a/server/AyaNova/AyaNova.csproj b/server/AyaNova/AyaNova.csproj index 765ff672..8ed859c3 100644 --- a/server/AyaNova/AyaNova.csproj +++ b/server/AyaNova/AyaNova.csproj @@ -17,33 +17,33 @@ - + - - - + + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - - - - + + + + - - - - - + + + + + diff --git a/server/AyaNova/biz/PMBiz.cs b/server/AyaNova/biz/PMBiz.cs index bd095602..94498599 100644 --- a/server/AyaNova/biz/PMBiz.cs +++ b/server/AyaNova/biz/PMBiz.cs @@ -4721,7 +4721,7 @@ namespace AyaNova.Biz // internal static async Task GenerateAsync(AyContext ct, ILogger log) { - //if(!KeepOnWorking(log)) return; + if(!KeepOnWorking(log)) return; //Get a list of PM id's ready for conversion now @@ -4771,6 +4771,7 @@ namespace AyaNova.Biz { //extremely unlikely to happen but just in case... log.LogError($"PM was not fetchable when attempting to process PM id: {pmid}, deleted during processing?"); + if(!KeepOnWorking(log)) return; continue; } try @@ -4861,6 +4862,7 @@ namespace AyaNova.Biz { log.LogError(ex, $"error updating PM after generation {p.Serial}"); await NotifyEventHelper.AddGeneralNotifyEvent(AyaType.PM, p.Id, NotifyEventType.PMGenerationFailed, $"Error updating PM after generation {p.Serial}", "Preventive Maintenance", ex); + if(!KeepOnWorking(log)) return; continue; } } @@ -4870,6 +4872,7 @@ namespace AyaNova.Biz { log.LogError(ex, $"error generating Work order from PM {p.Serial}"); await NotifyEventHelper.AddGeneralNotifyEvent(AyaType.PM, p.Id, NotifyEventType.PMGenerationFailed, $"Error generating Work order from PM {p.Serial}", "Preventive Maintenance", ex); + if(!KeepOnWorking(log)) return; continue; } diff --git a/server/AyaNova/util/DbUtil.cs b/server/AyaNova/util/DbUtil.cs index a66f9601..cb59b0aa 100644 --- a/server/AyaNova/util/DbUtil.cs +++ b/server/AyaNova/util/DbUtil.cs @@ -565,7 +565,7 @@ namespace AyaNova.Util // CALLED BY by login ping from client via notify controller internal static async Task DBHasTrialUsersAsync(AyContext ct, ILogger _log) { - _log.LogDebug("DB trial users presence check"); + _log.LogDebug("DB trial users presence check for pre-login ping"); //There are 22 trial users (more but for internal use) in a trial database if (await ct.User.LongCountAsync() < 22) return false;