Fixing report timeout error message problem recently introduced when changed timeout process

This commit is contained in:
2022-01-19 19:50:53 +00:00
parent 6e21b681e3
commit 182e68965e
2 changed files with 5 additions and 2 deletions

View File

@@ -846,6 +846,7 @@ namespace AyaNova.Biz
{ {
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}"); 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}");
var json = Newtonsoft.Json.JsonConvert.SerializeObject(new { rendererror = new { timeout = true, timeoutsetting = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT } }, Newtonsoft.Json.Formatting.None); var json = Newtonsoft.Json.JsonConvert.SerializeObject(new { rendererror = new { timeout = true, timeoutsetting = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT } }, Newtonsoft.Json.Formatting.None);
//"{\"rendererror\":{\"timeout\":1}}"
await JobsBiz.LogJobAsync(job.GId, json); await JobsBiz.LogJobAsync(job.GId, json);
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Failed); await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Failed);

View File

@@ -64,12 +64,14 @@ namespace AyaNova.Util
{ {
if (instance.Expires < DateTime.UtcNow) if (instance.Expires < DateTime.UtcNow)
{ {
await JobsBiz.LogJobAsync(instance.JobId, $"rendererror:timeout,{ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT}");//parseable for print client var json = Newtonsoft.Json.JsonConvert.SerializeObject(new { rendererror = new { timeout = true, timeoutsetting = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT } }, Newtonsoft.Json.Formatting.None);
await JobsBiz.LogJobAsync(instance.JobId, json);
await JobsBiz.UpdateJobStatusAsync(instance.JobId, JobStatus.Failed); await JobsBiz.UpdateJobStatusAsync(instance.JobId, JobStatus.Failed);
} }
else else
{ {
await JobsBiz.LogJobAsync(instance.JobId, $"rendererror:cancelled"); var json = Newtonsoft.Json.JsonConvert.SerializeObject(new { rendererror = new { cancelled = true} }, Newtonsoft.Json.Formatting.None);
await JobsBiz.LogJobAsync(instance.JobId, json);
await JobsBiz.UpdateJobStatusAsync(instance.JobId, JobStatus.Completed); await JobsBiz.UpdateJobStatusAsync(instance.JobId, JobStatus.Completed);
} }
} }