U4-6626 - XmlCache, bugfix locks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user