U4-6626 - XmlCache, bugfix locks

This commit is contained in:
Stephan
2015-05-19 20:08:52 +02:00
parent 009f071f48
commit ac7ff31a67
5 changed files with 57 additions and 13 deletions

View File

@@ -541,11 +541,13 @@ namespace Umbraco.Web.Scheduling
{
HostingEnvironment.UnregisterObject(this);
LogHelper.Info<BackgroundTaskRunner<T>>("Down, tasks completed.");
Stopped.RaiseEvent(new StoppedEventArgs(false), this);
});
else
{
HostingEnvironment.UnregisterObject(this);
LogHelper.Info<BackgroundTaskRunner<T>>("Down, tasks completed.");
Stopped.RaiseEvent(new StoppedEventArgs(false), this);
}
}
}
@@ -560,9 +562,20 @@ namespace Umbraco.Web.Scheduling
Shutdown(true, true); // cancel all tasks, wait for the current one to end
HostingEnvironment.UnregisterObject(this);
LogHelper.Info<BackgroundTaskRunner<T>>("Down.");
Stopped.RaiseEvent(new StoppedEventArgs(true), this);
}
}
public class StoppedEventArgs : EventArgs
{
public StoppedEventArgs(bool immediate)
{
Immediate = immediate;
}
public bool Immediate { get; private set; }
}
public event TypedEventHandler<BackgroundTaskRunner<T>, StoppedEventArgs> Stopped;
}
}