From f2d9da5549e342592ddbf12949f799b44bab9937 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 28 Oct 2021 18:53:27 +0000 Subject: [PATCH] --- server/AyaNova/Controllers/ReportController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/AyaNova/Controllers/ReportController.cs b/server/AyaNova/Controllers/ReportController.cs index c3f43021..c3e68add 100644 --- a/server/AyaNova/Controllers/ReportController.cs +++ b/server/AyaNova/Controllers/ReportController.cs @@ -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());