server state cleanup

This commit is contained in:
2020-04-05 23:02:18 +00:00
parent d3d2fe8c46
commit 4af7664dce
10 changed files with 59 additions and 127 deletions

View File

@@ -54,10 +54,8 @@ namespace AyaNova.Api.Controllers
[HttpPost("seed/{size}/{timeZoneOffset}")]
public async Task<IActionResult> SeedTrialDatabase([FromRoute] string size, [FromRoute] decimal timeZoneOffset)
{
if (!serverState.IsOpen)
{
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
}
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!ModelState.IsValid)
{