Scheduler - does not run tasks if not MainDom
This commit is contained in:
@@ -29,11 +29,18 @@ namespace Umbraco.Web.Scheduling
|
||||
{
|
||||
if (_appContext == null) return true; // repeat...
|
||||
|
||||
string umbracoAppUrl = null;
|
||||
|
||||
try
|
||||
// ensure we do not run if not main domain, but do NOT lock it
|
||||
if (_appContext.MainDom.IsMainDom == false)
|
||||
{
|
||||
using (DisposableTimer.DebugDuration<KeepAlive>(() => "Keep alive executing", () => "Keep alive complete"))
|
||||
LogHelper.Debug<ScheduledPublishing>("Does not run if not MainDom.");
|
||||
return false; // do NOT repeat, going down
|
||||
}
|
||||
|
||||
using (DisposableTimer.DebugDuration<KeepAlive>(() => "Keep alive executing", () => "Keep alive complete"))
|
||||
{
|
||||
string umbracoAppUrl = null;
|
||||
|
||||
try
|
||||
{
|
||||
umbracoAppUrl = _appContext.UmbracoApplicationUrl;
|
||||
if (umbracoAppUrl.IsNullOrWhiteSpace())
|
||||
@@ -54,10 +61,10 @@ namespace Umbraco.Web.Scheduling
|
||||
var result = await wc.SendAsync(request, token);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error<KeepAlive>(string.Format("Failed (at \"{0}\").", umbracoAppUrl), e);
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error<KeepAlive>(string.Format("Failed (at \"{0}\").", umbracoAppUrl), e);
|
||||
}
|
||||
}
|
||||
|
||||
return true; // repeat
|
||||
|
||||
@@ -65,6 +65,13 @@ namespace Umbraco.Web.Scheduling
|
||||
return false; // do NOT repeat, server status comes from config and will NOT change
|
||||
}
|
||||
|
||||
// ensure we do not run if not main domain, but do NOT lock it
|
||||
if (_appContext.MainDom.IsMainDom == false)
|
||||
{
|
||||
LogHelper.Debug<LogScrubber>("Does not run if not MainDom.");
|
||||
return false; // do NOT repeat, going down
|
||||
}
|
||||
|
||||
using (DisposableTimer.DebugDuration<LogScrubber>("Log scrubbing executing", "Log scrubbing complete"))
|
||||
{
|
||||
Log.CleanLogs(GetLogScrubbingMaximumAge(_settings));
|
||||
|
||||
@@ -38,6 +38,13 @@ namespace Umbraco.Web.Scheduling
|
||||
return false; // do NOT repeat, server status comes from config and will NOT change
|
||||
}
|
||||
|
||||
// ensure we do not run if not main domain, but do NOT lock it
|
||||
if (_appContext.MainDom.IsMainDom == false)
|
||||
{
|
||||
LogHelper.Debug<ScheduledPublishing>("Does not run if not MainDom.");
|
||||
return false; // do NOT repeat, going down
|
||||
}
|
||||
|
||||
using (DisposableTimer.DebugDuration<ScheduledPublishing>(() => "Scheduled publishing executing", () => "Scheduled publishing complete"))
|
||||
{
|
||||
string umbracoAppUrl = null;
|
||||
|
||||
@@ -101,6 +101,13 @@ namespace Umbraco.Web.Scheduling
|
||||
return false; // do NOT repeat, server status comes from config and will NOT change
|
||||
}
|
||||
|
||||
// ensure we do not run if not main domain, but do NOT lock it
|
||||
if (_appContext.MainDom.IsMainDom == false)
|
||||
{
|
||||
LogHelper.Debug<ScheduledTasks>("Does not run if not MainDom.");
|
||||
return false; // do NOT repeat, going down
|
||||
}
|
||||
|
||||
using (DisposableTimer.DebugDuration<ScheduledTasks>(() => "Scheduled tasks executing", () => "Scheduled tasks complete"))
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user