From 0864abf309e0e8a502be376b20324519c96e5e42 Mon Sep 17 00:00:00 2001 From: Elijah R Date: Sun, 2 Jun 2024 13:14:51 -0400 Subject: [PATCH] Allow up to 10 minutes for chatlog queries because they can be slow --- EmperorPalpatine/HTTPServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EmperorPalpatine/HTTPServer.cs b/EmperorPalpatine/HTTPServer.cs index 147601f..80c3bcf 100644 --- a/EmperorPalpatine/HTTPServer.cs +++ b/EmperorPalpatine/HTTPServer.cs @@ -23,7 +23,8 @@ public class HTTPServer this.app.MapGet("/api/v1/list", (Delegate) VMListHandler); this.app.MapGet("/api/v1/vminfo/{vm:required}", VmInfoHandler); this.app.MapGet("/api/v1/screenshot/{vm:required}", VMScreenshotHandler); - this.app.MapGet("/api/v1/chatlogs", (Delegate) VMChatlogHandler); + // Allow up to 10 minutes for chatlog queries because they can be slow + this.app.MapGet("/api/v1/chatlogs", (Delegate)VMChatlogHandler).WithRequestTimeout(TimeSpan.FromMinutes(10)); this.app.MapGet("/api/v1/mod/iptousername/{ip:required}", IPToUsernameHandler); this.app.MapGet("/api/v1/mod/usernametoip/{username:required}", UsernameToIPHandler); this.app.Lifetime.ApplicationStarted.Register(this.onServerStarted);