แก้ time out
This commit is contained in:
parent
0a42e68b28
commit
4e84e76daf
2 changed files with 28 additions and 9 deletions
|
|
@ -93,6 +93,12 @@ builder.Services.AddTransient<MailService>();
|
|||
builder.Services.AddTransient<CMSCandidateService>();
|
||||
builder.Services.AddTransient<PermissionRepository>();
|
||||
|
||||
// Configure HttpClient with timeout
|
||||
builder.Services.AddHttpClient("default", client =>
|
||||
{
|
||||
client.Timeout = TimeSpan.FromSeconds(30);
|
||||
});
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
|
|
@ -128,11 +134,11 @@ app.UseHttpsRedirection();
|
|||
app.UseCors();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.UseMiddleware<RequestLoggingMiddleware>();
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
app.MapControllers();
|
||||
|
||||
app.UseMiddleware<RequestLoggingMiddleware>();
|
||||
|
||||
// apply migrations
|
||||
await using var scope = app.Services.CreateAsyncScope();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue