I need to make an async POST request to a part of my API, and the query is taking around 30 minutes.
When I try on local it works fine both on Debug and Release, but when I am publishing to my hosting provider, the request gets interrupted after around 2 minutes, and the server responds with error 500 or 502.
I already tried to add the following lines to my web.config
file:
<system.webServer>
<aspNetCore requestTimeout="10:00:00">
<environmentVariables />
</aspNetCore>
</system.webServer>
<system.web>
<globalization uiCulture="fr-FR" culture="fr-FR" />
<httpRuntime executionTimeout="10000" />
</system.web>
And also to modify the request timeout via Kestrel options in Program.cs
:
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(o => { o.Limits.KeepAliveTimeout = TimeSpan.FromDays(1); });
With no effects unfortunatly. What can I do to not have my query interrupted?