Merge branch temp8 into temp8-di2690
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Umbraco.Web.Scheduling
|
||||
{
|
||||
private readonly IRuntimeState _runtime;
|
||||
private readonly ILogger _logger;
|
||||
private static HttpClient _httpClient;
|
||||
private readonly ProfilingLogger _proflog;
|
||||
|
||||
public KeepAlive(IBackgroundTaskRunner<RecurringTaskBase> runner, int delayMilliseconds, int periodMilliseconds,
|
||||
@@ -21,6 +22,8 @@ namespace Umbraco.Web.Scheduling
|
||||
_runtime = runtime;
|
||||
_logger = logger;
|
||||
_proflog = proflog;
|
||||
if (_httpClient == null)
|
||||
_httpClient = new HttpClient();
|
||||
}
|
||||
|
||||
public override async Task<bool> PerformRunAsync(CancellationToken token)
|
||||
@@ -57,11 +60,9 @@ namespace Umbraco.Web.Scheduling
|
||||
}
|
||||
|
||||
var url = umbracoAppUrl + "/ping.aspx";
|
||||
using (var wc = new HttpClient())
|
||||
{
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
||||
var result = await wc.SendAsync(request, token);
|
||||
}
|
||||
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
||||
var result = await _httpClient.SendAsync(request, token);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user