This commit is contained in:
2021-10-28 18:53:27 +00:00
parent d446fafa58
commit f2d9da5549

View File

@@ -200,9 +200,17 @@ namespace AyaNova.Api.Controllers
//Note that this *should* normally return a 503 however we're pretty tightly wired into that meaning the server is closed at the client end which
//handles it at a lower 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 (DEBUG)
//50% chance of timeout
// var random = new Random();
// if (random.Next(10) < 5)
//return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_SERVER_ERROR, null, "busy"));
return Ok(ApiOkResponse.Response(new { busy = true, retryms = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT }));
#endif
if (!Util.ReportRenderManager.RenderSlotAvailable(log))
return Ok(ApiOkResponse.Response(new { busy = true, retryms = ServerBootConfig.AYANOVA_REPORT_RENDERING_TIMEOUT }));
ReportBiz biz = ReportBiz.GetBiz(ct, HttpContext);
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());