This commit is contained in:
@@ -196,12 +196,8 @@ namespace AyaNova.Api.Controllers
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
//return if no free slot
|
||||
//Note that this *should* normally return a 503 however this is not an unexpected result and we're pretty tightly wired into that meaning the server is closed at the client end which
|
||||
//handles it at a lower api level
|
||||
//returning an OK method here allows the client to handle it at the level of the report dialog rather than the api handler which will short circuit if it was a 503
|
||||
if (!Util.ReportRenderManager.RenderSlotAvailable(log))
|
||||
return Ok(ApiOkResponse.Response(new { busy = true, retryms = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT }));
|
||||
//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))
|
||||
@@ -213,9 +209,9 @@ namespace AyaNova.Api.Controllers
|
||||
var API_URL = $"http://127.0.0.1:{httpConnectionFeature.LocalPort}/api/v8/";
|
||||
try
|
||||
{
|
||||
var Expires = DateTime.UtcNow.AddMinutes(ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT);
|
||||
var result = await biz.RenderReport(reportRequest, API_URL);
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(result))
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user