sets http client timeout to 1h

This commit is contained in:
benbierens 2024-11-11 16:21:58 +01:00
parent 0129af6fd7
commit 55cc0ab0ef
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
1 changed files with 3 additions and 2 deletions

View File

@ -81,13 +81,13 @@ public class Program
foreach (var e in endpointStrs)
{
result.Add(await CreateUser(e));
result.Add(await CreateCodexInstance(e));
}
return result.ToArray();
}
private async Task<CodexInstance> CreateUser(string endpoint)
private async Task<CodexInstance> CreateCodexInstance(string endpoint)
{
var splitIndex = endpoint.LastIndexOf(':');
var host = endpoint.Substring(0, splitIndex);
@ -99,6 +99,7 @@ public class Program
);
var client = new HttpClient();
client.Timeout = TimeSpan.FromMinutes(60.0);
var codex = new CodexApi(client);
codex.BaseUrl = $"{address.Host}:{address.Port}/api/codex/v1";