diff --git a/server/AyaNova/biz/JobsBiz.cs b/server/AyaNova/biz/JobsBiz.cs index a77c106b..a05f875b 100644 --- a/server/AyaNova/biz/JobsBiz.cs +++ b/server/AyaNova/biz/JobsBiz.cs @@ -182,7 +182,7 @@ namespace AyaNova.Biz if (ActivelyProcessing) { //System.Diagnostics.Debug.WriteLine("ProcessJobs called but actively processing other jobs so returning"); - log.LogTrace("ProcessJobs called but actively processing other jobs so returning"); + //log.LogTrace("ProcessJobs called but actively processing other jobs so returning"); return; } if (!KeepOnWorking()) return; diff --git a/server/AyaNova/generator/Generate.cs b/server/AyaNova/generator/Generate.cs index 55810591..4c2f3c01 100644 --- a/server/AyaNova/generator/Generate.cs +++ b/server/AyaNova/generator/Generate.cs @@ -20,11 +20,11 @@ namespace AyaNova.Generator { private readonly ILogger log; // private const int MAXIMUM_MS_ALLOWED_FOR_PROCESSING_ALL_JOBS = 1 * 60 * 1000;//1 minutes TEST TEST TEST ##### -#if (DEBUG) - private const int GENERATE_SECONDS = 5; -#else - private const int GENERATE_SECONDS = 20; -#endif +// #if (DEBUG) +// private const int GENERATE_SECONDS = 1; +// #else +// private const int GENERATE_SECONDS = 20; +// #endif @@ -38,7 +38,7 @@ namespace AyaNova.Generator protected override async Task ExecuteAsync(CancellationToken stoppingToken) { - log.LogDebug($"GeneratorService is starting."); + log.LogInformation($"GeneratorService is starting."); stoppingToken.Register(() => log.LogDebug($" GeneratorService background task is stopping.")); @@ -48,7 +48,7 @@ namespace AyaNova.Generator { if (!ServerGlobalOpsSettingsCache.BOOTING) { - log.LogDebug($"GeneratorService running jobs"); + // log.LogTrace($"GeneratorService running jobs"); //================================================================= try @@ -61,9 +61,14 @@ namespace AyaNova.Generator } //================================================================= } - await Task.Delay((GENERATE_SECONDS * 1000), stoppingToken); + //There *MUST* be a delay here or the server will come to a standstill + //ideally need to move on from this method of generation to something external or more reasonable but + //this does work, we need to get to release, for our projected use load this should be fine and it's + //a documented by MS method to do asp.net core job processing + //https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-6.0&tabs=visual-studio + await Task.Delay(1000); } - log.LogDebug($"GeneratorService is stopping"); + log.LogInformation($"GeneratorService is stopping"); } public override Task StopAsync(CancellationToken stoppingToken)