public async Task InvokeAsync()

in src/Relecloud.Web.CallCenter.Api/Infrastructure/IntermittentErrorRequestMiddleware.cs [24:39]


    public async Task InvokeAsync(HttpContext context)
    {
        if (_backToBackExceptionCount == -1)
        {
            LoadConfiguration(context);
        }

        if (_backToBackExceptionCount > 0 && ++_requestCount % (_backToBackExceptionCount + 1) > 0)
        {
            // When enabled this simulation demonstrates the retry pattern
            await ReturnErrorResponse(context);
            return;
        }

        await _next(context);
    }