Merge branch 7.2.7 into dev-v7
Conflicts: build/UmbracoVersion.txt src/SolutionInfo.cs src/Umbraco.Core/ApplicationContext.cs src/Umbraco.Core/AsyncLock.cs src/Umbraco.Core/Cache/DictionaryCacheProviderBase.cs src/Umbraco.Core/Cache/ObjectCacheRuntimeCacheProvider.cs src/Umbraco.Core/CoreBootManager.cs src/Umbraco.Core/Logging/LogHelper.cs src/Umbraco.Core/PluginManager.cs src/Umbraco.Core/Sync/ServerEnvironmentHelper.cs src/Umbraco.Core/TypeFinder.cs src/Umbraco.Core/Umbraco.Core.csproj src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs src/Umbraco.Tests/ServerEnvironmentHelperTests.cs src/Umbraco.Web.UI.Client/bower.json src/Umbraco.Web.UI.Client/gruntFile.js src/Umbraco.Web.UI.Client/src/less/grid.less src/Umbraco.Web.UI.Client/src/less/panel.less src/Umbraco.Web.UI.Client/src/less/property-editors.less src/Umbraco.Web.UI.Client/src/loader.js src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js src/Umbraco.Web.UI/Umbraco.Web.UI.csproj src/Umbraco.Web.UI/config/ClientDependency.config src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlCacheFilePersister.cs src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs src/Umbraco.Web/Scheduling/KeepAlive.cs src/Umbraco.Web/Scheduling/LatchedBackgroundTaskBase.cs src/Umbraco.Web/Scheduling/LogScrubber.cs src/Umbraco.Web/Scheduling/RecurringTaskBase.cs src/Umbraco.Web/Scheduling/ScheduledPublishing.cs src/Umbraco.Web/Scheduling/ScheduledTasks.cs src/Umbraco.Web/Scheduling/Scheduler.cs src/Umbraco.Web/UI/JavaScript/JsInitialize.js src/Umbraco.Web/Umbraco.Web.csproj src/Umbraco.Web/umbraco.presentation/content.cs src/umbraco.cms/Actions/Action.cs
This commit is contained in:
@@ -38,7 +38,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
private const int MaxWaitMilliseconds = 30000; // save the cache after some time (ie no more than 30s of changes)
|
||||
|
||||
// save the cache when the app goes down
|
||||
public override bool RunsOnShutdown { get { return true; } }
|
||||
public override bool RunsOnShutdown { get { return _timer != null; } }
|
||||
|
||||
// initialize the first instance, which is inactive (not touched yet)
|
||||
public XmlCacheFilePersister(IBackgroundTaskRunner<XmlCacheFilePersister> runner, content content, ProfilingLogger logger)
|
||||
@@ -142,13 +142,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
lock (_locko)
|
||||
{
|
||||
_logger.Logger.Debug<XmlCacheFilePersister>("Timer: release.");
|
||||
if (_timer != null)
|
||||
_timer.Dispose();
|
||||
_timer = null;
|
||||
_released = true;
|
||||
|
||||
// if running (because of shutdown) this will have no effect
|
||||
// else it tells the runner it is time to run the task
|
||||
Release();
|
||||
}
|
||||
}
|
||||
@@ -197,5 +192,15 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_content.SaveXmlToFile();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void DisposeResources()
|
||||
{
|
||||
base.DisposeResources();
|
||||
|
||||
// stop the timer
|
||||
if (_timer == null) return;
|
||||
_timer.Change(Timeout.Infinite, Timeout.Infinite);
|
||||
_timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user