test error
This commit is contained in:
parent
c91d9d72c5
commit
f6b1e7779d
2 changed files with 28 additions and 14 deletions
13
Program.cs
13
Program.cs
|
|
@ -67,6 +67,12 @@ builder.Services.AddTransient<RecruitService>();
|
|||
builder.Services.AddTransient<MinIOService>();
|
||||
builder.Services.AddTransient<PermissionRepository>();
|
||||
|
||||
// Configure HttpClient with timeout
|
||||
builder.Services.AddHttpClient("default", client =>
|
||||
{
|
||||
client.Timeout = TimeSpan.FromSeconds(30);
|
||||
});
|
||||
|
||||
// use serilog
|
||||
//ConfigureLogs();
|
||||
//builder.Host.UseSerilog();
|
||||
|
|
@ -107,10 +113,6 @@ builder.Services.AddSwaggerGen();
|
|||
builder.Services.ConfigureOptions<ConfigureSwaggerOptions>();
|
||||
builder.Services.AddHealthChecks();
|
||||
|
||||
// Register Service
|
||||
builder.Services.AddTransient<RecruitService>();
|
||||
builder.Services.AddTransient<MinIOService>();
|
||||
|
||||
var app = builder.Build();
|
||||
var apiVersionDescriptionProvider = app.Services.GetRequiredService<IApiVersionDescriptionProvider>();
|
||||
|
||||
|
|
@ -133,12 +135,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();
|
||||
await using var db = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue