Configure HttpClient to use a 10-minute timeout for long-running operations
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
This commit is contained in:
parent
5c05f1123a
commit
0a170fd259
1 changed files with 5 additions and 2 deletions
|
|
@ -97,9 +97,12 @@ builder.Services.AddLeavePersistence(builder.Configuration);
|
|||
builder.Services.AddTransient<HolidayService>();
|
||||
|
||||
// Configure HttpClient with increased timeout for long-running operations (e.g., RabbitMQ Management API)
|
||||
builder.Services.AddHttpClient<HttpClient>(client =>
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddTransient(sp =>
|
||||
{
|
||||
client.Timeout = TimeSpan.FromMinutes(10); // Set timeout to 10 minutes
|
||||
var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient();
|
||||
httpClient.Timeout = TimeSpan.FromMinutes(10); // Set timeout to 10 minutes
|
||||
return httpClient;
|
||||
});
|
||||
|
||||
builder.Services.AddControllers(options =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue