diff --git a/.vscode/launch.json b/.vscode/launch.json index cddb1cbc..7f996a36 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -40,8 +40,8 @@ "env": { // "ASPNETCORE_ENVIRONMENT": "Development", "AYANOVA_JWT_SECRET": "1111111MyRandom32CharacterSecret", - //"AYANOVA_LOG_LEVEL": "Info", - "AYANOVA_LOG_LEVEL": "Debug", + "AYANOVA_LOG_LEVEL": "Info", + //"AYANOVA_LOG_LEVEL": "Debug", // // "AYANOVA_LOG_LEVEL": "Trace", "AYANOVA_DEFAULT_TRANSLATION": "en", "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=120;", diff --git a/server/AyaNova/Controllers/ReportController.cs b/server/AyaNova/Controllers/ReportController.cs index 331ebe28..29206008 100644 --- a/server/AyaNova/Controllers/ReportController.cs +++ b/server/AyaNova/Controllers/ReportController.cs @@ -195,53 +195,6 @@ namespace AyaNova.Api.Controllers } - // /// - // /// Render Report - // /// - // /// report id and object id values for object type specified in report template - // /// From route path - // /// downloadable pdf name - // [HttpPost("render")] - // public async Task RenderReport([FromBody] DataListReportRequest reportRequest, ApiVersion apiVersion) - // { - // if (!serverState.IsOpen) - // return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason)); - - // //this is done by a recurring JOB now so no longer needed here - // // //check for an kill any expired prior renders stuck around - // // Util.ReportRenderManager.KillExpiredRenders(log); - - // ReportBiz biz = ReportBiz.GetBiz(ct, HttpContext); - // if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType)) - // return StatusCode(403, new ApiNotAuthorizedResponse()); - // if (!ModelState.IsValid) - // return BadRequest(new ApiErrorResponse(ModelState)); - - // var httpConnectionFeature = HttpContext.Features.Get(); - // var API_URL = $"http://127.0.0.1:{httpConnectionFeature.LocalPort}/api/v8/"; - // try - // { - // var result = await biz.RenderReport(reportRequest, DateTime.UtcNow.AddMinutes(ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT), API_URL); - // if (string.IsNullOrWhiteSpace(result)) - // return BadRequest(new ApiErrorResponse(biz.Errors)); - // else - // return Ok(ApiOkResponse.Response(result)); - // } - // catch (ReportRenderTimeOutException) - // { - // log.LogInformation($"Report render timeout, exceeded timeout setting of {ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT} minutes, report id: {reportRequest.ReportId}, record count:{reportRequest.SelectedRowIds.LongLength}, user:{UserNameFromContext.Name(HttpContext.Items)} "); - // return Ok(ApiOkResponse.Response(new { timeout = true, timeoutconfigminutes = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT })); - // } - // catch (System.Exception ex) - // { - // //The Javascript evaluation stack trace can be in the message making it long and internalized, - // //however the info is useful as it can indicate exactly which function failed etc so sending it all back is best - // return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, ex.Message)); - // } - // } - - - /// /// Start Render Report job /// diff --git a/server/AyaNova/biz/ReportBiz.cs b/server/AyaNova/biz/ReportBiz.cs index 96d728b5..c680d000 100644 --- a/server/AyaNova/biz/ReportBiz.cs +++ b/server/AyaNova/biz/ReportBiz.cs @@ -799,7 +799,7 @@ namespace AyaNova.Biz } catch (PuppeteerSharp.TargetClosedException) { - log.LogDebug("Caught PuppeteerSharp.TargetClosedException throwing as ReportRendertimeOutException (timed out and closed from process sweeper)"); + log.LogDebug("Caught PuppeteerSharp.TargetClosedException - report was cancelled by user OR timed out"); //we closed it because the timeout hit and the CoreJobReportRenderEngineProcessCleanup job cleaned it out //so return the error the client expects in this scenario await HandleTimeOut(job, log, reportRequest, userName); @@ -844,7 +844,7 @@ namespace AyaNova.Biz static async Task HandleTimeOut(OpsJob job, ILogger log, DataListReportRequest reportRequest, string userName) { - log.LogInformation($"Report render timeout, exceeded timeout setting of {ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT} minutes, report id: {reportRequest.ReportId}, record count:{reportRequest.SelectedRowIds.LongLength}, user:{userName}"); + log.LogDebug($"Report render cancelled by user OR exceeded timeout setting of {ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT} minutes, report id: {reportRequest.ReportId}, record count:{reportRequest.SelectedRowIds.LongLength}, user:{userName}"); await JobsBiz.LogJobAsync(job.GId, $"rendererror:timeout,{ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT}");//parseable for print client await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Failed); } diff --git a/server/AyaNova/util/ReportProcessManager.cs b/server/AyaNova/util/ReportProcessManager.cs index 580d862a..c20dfcf2 100644 --- a/server/AyaNova/util/ReportProcessManager.cs +++ b/server/AyaNova/util/ReportProcessManager.cs @@ -111,8 +111,7 @@ namespace AyaNova.Util { log.LogDebug($"AddJob - {jobId} to the collection"); _baginstances.Add(new ReportRenderInstanceInfo(jobId, DateTime.UtcNow.AddMinutes(ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT))); - - log.LogInformation($"AddJob - there are currently {_baginstances.Count} instances in the collection"); + log.LogDebug($"AddJob - there are currently {_baginstances.Count} instances in the collection"); }