Fixes #4071 - Error executing scheduled task - This instance has already started one or more requests.
This commit is contained in:
@@ -63,10 +63,11 @@ namespace Umbraco.Web.Scheduling
|
||||
private async Task<bool> GetTaskByHttpAync(string url, CancellationToken token)
|
||||
{
|
||||
if (_httpClient == null)
|
||||
_httpClient = new HttpClient();
|
||||
|
||||
if (Uri.TryCreate(_appContext.UmbracoApplicationUrl, UriKind.Absolute, out var baseUri))
|
||||
_httpClient.BaseAddress = baseUri;
|
||||
{
|
||||
_httpClient = Uri.TryCreate(_appContext.UmbracoApplicationUrl, UriKind.Absolute, out var baseUri)
|
||||
? new HttpClient { BaseAddress = baseUri }
|
||||
: new HttpClient();
|
||||
}
|
||||
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user