Add delay to requests to simulate slow connection

This commit is contained in:
2020-03-09 17:47:49 +01:00
parent 13a87b7094
commit 2262340754
2 changed files with 32 additions and 14 deletions

View File

@@ -0,0 +1,22 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Filters;
namespace EstusShots.Server.Filters
{
/// <summary>
/// Adds 2 seconds of wait time to each request
/// </summary>
public class DebugDelayFilter : IActionFilter
{
public void OnActionExecuted(ActionExecutedContext context)
{
}
public void OnActionExecuting(ActionExecutingContext context)
{
Task.Delay(2000).Wait();
}
}
}