I use a backgroundworker in my asp.net core web-service. In this backgroundworker I use:
var response = await client.PostAsync(baseUri + "/api/worker/" + Id , content);
This works fine if the call takes less than 100 seconds, but if it takes longer, then it thows a TaskCanceldException.
So how can I increase this timeout?
If the client var is HttpClient, you can set its Timeout property.
HttpClient httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromMinutes(10);
Here is the official doc