【发布时间】:2022-01-07 02:02:14
【问题描述】:
我需要确保同步请求保持活动状态超过 60 分钟。 有没有办法更改 DotNet 6 中的默认入站请求超时?
我发现了这个:
serverOptions.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(60);
但不确定在我的 Program.cs 中从何处获取 serverOptions
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
【问题讨论】:
标签: asp.net-mvc asp.net-core kestrel