This commit is contained in:
2021-10-28 20:11:34 +00:00
parent 6755f237af
commit 5a73c88653

View File

@@ -197,17 +197,9 @@ namespace AyaNova.Api.Controllers
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
//return if no free slot
//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
//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 (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 }));