From 31d0dfc7d37a6a8e7d51a69882c6ec2324dd2c51 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sat, 30 Oct 2021 19:42:07 -0500 Subject: [PATCH] reduce timeout when master api is down --- Application/Main.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Main.cs b/Application/Main.cs index f57025c2d..70acbd4f1 100644 --- a/Application/Main.cs +++ b/Application/Main.cs @@ -19,6 +19,7 @@ using SharedLibraryCore.Services; using Stats.Dtos; using System; using System.Linq; +using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -342,7 +343,12 @@ namespace IW4MAdmin.Application var masterUri = Utilities.IsDevelopment ? new Uri("http://127.0.0.1:8080") : appConfig?.MasterUrl ?? new ApplicationConfiguration().MasterUrl; - var masterRestClient = RestClient.For(masterUri); + var httpClient = new HttpClient + { + BaseAddress = masterUri, + Timeout = TimeSpan.FromSeconds(15) + }; + var masterRestClient = RestClient.For(httpClient); var translationLookup = Configure.Initialize(Utilities.DefaultLogger, masterRestClient, appConfig); if (appConfig == null)