This commit is contained in:
2021-12-23 17:48:01 +00:00
parent 8753c41f6b
commit 04abe2adcb
34 changed files with 115 additions and 81 deletions

View File

@@ -175,12 +175,20 @@ namespace AyaNova.Api.Controllers
//cap the data returned
selectedRequest.ReportDesignerSample = true;
var reportData = await biz.GetReportData(selectedRequest);
if (reportData == null)
return BadRequest(new ApiErrorResponse(biz.Errors));
else
return Ok(ApiOkResponse.Response(reportData));
JArray reportData;
try
{
reportData = await biz.GetReportData(selectedRequest, DateTime.UtcNow.AddMinutes(ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT));
if (reportData == null)
return BadRequest(new ApiErrorResponse(biz.Errors));
else
return Ok(ApiOkResponse.Response(reportData));
}
catch (ReportRenderTimeOutException)
{
log.LogInformation($"GetReportData timeout data list key: {selectedRequest.DataListKey}, record count:{selectedRequest.SelectedRowIds.LongLength}, user:{UserNameFromContext.Name(HttpContext.Items)} ");
return Ok(ApiOkResponse.Response(new { timeout = true, timeoutconfig = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT }));
}
}
@@ -209,14 +217,17 @@ namespace AyaNova.Api.Controllers
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);
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 report id: {reportRequest.ReportId}, record count:{reportRequest.SelectedRowIds.LongLength}, user:{UserNameFromContext.Name(HttpContext.Items)} ");
return Ok(ApiOkResponse.Response(new { timeout = true, timeoutconfig = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT }));
}
catch (System.Exception ex)
{
//The Javascript evaluation stack trace can be in the message making it long and internalized,