Skip to content

Commit

Permalink
Update http client configuration and corresponding catch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Sep 29, 2023
1 parent 9e3844f commit 63746aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/Serval.E2ETests/ServalClientHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ServalClientHelper(string audience, string prefix = "SCE_", bool ignoreSS
else
_httpClient = new HttpClient();
_httpClient.BaseAddress = new Uri(env["hostUrl"]);
_httpClient.Timeout = TimeSpan.FromSeconds(10);
_httpClient.Timeout = TimeSpan.FromSeconds(60);
dataFilesClient = new DataFilesClient(_httpClient);
translationEnginesClient = new TranslationEnginesClient(_httpClient);
_httpClient.DefaultRequestHeaders.Add(
Expand Down Expand Up @@ -127,10 +127,11 @@ public async Task BuildEngine(string engineId)
}
revision = result.Revision;
}
catch (TaskCanceledException e)
catch (ServalApiException e)
{
if (!e.Message.Contains("canceled due to the configured HttpClient.Timeout"))
if (e.StatusCode != 408)
throw;

// Throttle requests
await Task.Delay(500);
}
Expand Down

0 comments on commit 63746aa

Please sign in to comment.