quackquack
quackquack
CC#
Created by quackquack on 9/8/2023 in #help
❔ How do i set request time out for .NET 6?
public class Program
{
public static void Main(string[] args)
{
//Enable after handling database context
CreateHostBuilder(args).Build().MigrateDatabase().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseKestrel(option =>
{
option.Limits.KeepAliveTimeout = TimeSpan.FromSeconds(10);
});
webBuilder.UseStartup<Startup>();
});
}
public class Program
{
public static void Main(string[] args)
{
//Enable after handling database context
CreateHostBuilder(args).Build().MigrateDatabase().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseKestrel(option =>
{
option.Limits.KeepAliveTimeout = TimeSpan.FromSeconds(10);
});
webBuilder.UseStartup<Startup>();
});
}
This is my Program.cs, i've tried setting the option.Limits.KeepAliveTimeout to 10s but the request that takes longer than that doesn't just throw up
21 replies