|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using MediaBrowser.Api;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using MediaBrowser.Api;
|
|
|
|
|
using MediaBrowser.Common;
|
|
|
|
|
using MediaBrowser.Common.Configuration;
|
|
|
|
|
using MediaBrowser.Common.Constants;
|
|
|
|
@ -512,6 +513,16 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override void Restart()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var task = ServerManager.SendWebSocketMessageAsync("ServerRestarting", () => string.Empty, CancellationToken.None);
|
|
|
|
|
task.Wait();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logger.ErrorException("Error sending server restart web socket message", ex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
App.Instance.Restart();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -622,6 +633,16 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override void Shutdown()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var task = ServerManager.SendWebSocketMessageAsync("ServerShuttingDown", () => string.Empty, CancellationToken.None);
|
|
|
|
|
task.Wait();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Logger.ErrorException("Error sending server shutdown web socket message", ex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
App.Instance.Dispatcher.Invoke(App.Instance.Shutdown);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|