diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-07-01 20:51:15 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-07-01 20:51:15 +0200 |
commit | 7978f08235ceca22eacae11a88a7703513238cb3 (patch) | |
tree | 6a7058f21f6040cc1e9396a85774bc16ea133c9e /MatrixRoomUtils.Core/Services/HomeserverProviderService.cs | |
parent | Todays progress (diff) | |
download | MatrixUtils-7978f08235ceca22eacae11a88a7703513238cb3.tar.xz |
Deduplicate some api calls
Diffstat (limited to 'MatrixRoomUtils.Core/Services/HomeserverProviderService.cs')
-rw-r--r-- | MatrixRoomUtils.Core/Services/HomeserverProviderService.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs b/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs index 870e0d4..b2ea987 100644 --- a/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs +++ b/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs @@ -30,9 +30,9 @@ public class HomeserverProviderService { await _homeserverResolverService.ResolveHomeserverFromWellKnown(homeserver); hs._httpClient.Dispose(); hs._httpClient = new MatrixHttpClient { BaseAddress = new Uri(hs.FullHomeServerDomain) }; - hs._httpClient.Timeout = TimeSpan.FromSeconds(5); + hs._httpClient.Timeout = TimeSpan.FromSeconds(120); hs._httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); - + hs.WhoAmI = (await hs._httpClient.GetFromJsonAsync<WhoAmIResponse>("/_matrix/client/v3/account/whoami"))!; return hs; } @@ -43,7 +43,7 @@ public class HomeserverProviderService { await _homeserverResolverService.ResolveHomeserverFromWellKnown(homeserver); hs._httpClient.Dispose(); hs._httpClient = new MatrixHttpClient { BaseAddress = new Uri(hs.FullHomeServerDomain) }; - hs._httpClient.Timeout = TimeSpan.FromSeconds(5); + hs._httpClient.Timeout = TimeSpan.FromSeconds(120); return hs; } |