in src/Relecloud.Web.CallCenter.Api/Infrastructure/IntermittentErrorRequestMiddleware.cs [41:56]
private static void LoadConfiguration(HttpContext context)
{
var config = context.RequestServices.GetService<IConfiguration>();
if (config != null)
{
if (!string.IsNullOrEmpty(config["Api:App:RetryDemo"]))
{
if (int.TryParse(config["Api:App:RetryDemo"], out int newErrorRate))
{
// When set to 1 this simulation will return an error every other request
// When set to 2 this simulation will return two errors between successful requests
_backToBackExceptionCount = newErrorRate;
}
}
}
}