Trying to fix memory usage

This commit is contained in:
2025-05-26 19:20:53 +08:00
parent d76e0dd83b
commit 99f2e724a6
2 changed files with 39 additions and 16 deletions

View File

@ -39,7 +39,12 @@ using tusdotnet.Stores;
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseContentRoot(Directory.GetCurrentDirectory());
builder.WebHost.ConfigureKestrel(options => options.Limits.MaxRequestBodySize = long.MaxValue);
builder.WebHost.ConfigureKestrel(options =>
{
options.Limits.MaxRequestBodySize = long.MaxValue;
options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(2);
options.Limits.RequestHeadersTimeout = TimeSpan.FromSeconds(30);
});
// Add services to the container.
@ -327,4 +332,4 @@ app.MapTus("/files/tus", _ => Task.FromResult<DefaultTusConfiguration>(new()
}
}));
app.Run();
app.Run();