From ae7b06059ab855490fd74adc2cbf8f7817f6a73c Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 13 Apr 2023 20:00:45 +0200 Subject: [PATCH] Add sample endpoint that simulates a very slow one --- .../Endpoints/SlowEndpoint.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/bundles/Elsa.WorkflowServer.Web/Endpoints/SlowEndpoint.cs diff --git a/src/bundles/Elsa.WorkflowServer.Web/Endpoints/SlowEndpoint.cs b/src/bundles/Elsa.WorkflowServer.Web/Endpoints/SlowEndpoint.cs new file mode 100644 index 000000000..b8b9ec1c8 --- /dev/null +++ b/src/bundles/Elsa.WorkflowServer.Web/Endpoints/SlowEndpoint.cs @@ -0,0 +1,18 @@ +using FastEndpoints; + +namespace Elsa.WorkflowServer.Web.Endpoints; + +public class SlowEndpoint : EndpointWithoutRequest +{ + public override void Configure() + { + Get("/slow"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CancellationToken ct) + { + await Task.Delay(TimeSpan.FromSeconds(10), ct); + await SendOkAsync(ct); + } +} \ No newline at end of file