mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-08 08:48:48 +01:00
update restart command
This commit is contained in:
@@ -21,7 +21,7 @@ namespace MediaBrowser.Server.Mono.Native
|
||||
/// <summary>
|
||||
/// Restarts this instance.
|
||||
/// </summary>
|
||||
public virtual void Restart()
|
||||
public virtual void Restart(StartupOptions startupOptions)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
using MediaBrowser.Server.Startup.Common;
|
||||
|
||||
namespace MediaBrowser.Server.Mono.Native
|
||||
{
|
||||
/// <summary>
|
||||
@@ -29,9 +30,9 @@ namespace MediaBrowser.Server.Mono.Native
|
||||
/// <summary>
|
||||
/// Restarts this instance.
|
||||
/// </summary>
|
||||
public override void Restart()
|
||||
public override void Restart(StartupOptions startupOptions)
|
||||
{
|
||||
MainClass.Restart();
|
||||
MainClass.Restart(startupOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,19 +139,28 @@ namespace MediaBrowser.Server.Mono
|
||||
ApplicationTaskCompletionSource.SetResult(true);
|
||||
}
|
||||
|
||||
public static void Restart()
|
||||
public static void Restart(StartupOptions startupOptions)
|
||||
{
|
||||
_logger.Info("Disposing app host");
|
||||
_appHost.Dispose();
|
||||
|
||||
_logger.Info("Starting new instance");
|
||||
|
||||
var args = Environment.GetCommandLineArgs()
|
||||
.Skip(1)
|
||||
.Select(NormalizeCommandLineArgument);
|
||||
string module = startupOptions.GetOption("-restartpath");
|
||||
string commandLineArgsString = startupOptions.GetOption("-restartargs") ?? string.Empty;
|
||||
|
||||
var commandLineArgsString = string.Join(" ", args.ToArray());
|
||||
var module = Environment.GetCommandLineArgs().First();
|
||||
if (string.IsNullOrWhiteSpace(module))
|
||||
{
|
||||
module = Environment.GetCommandLineArgs().First();
|
||||
}
|
||||
if (!startupOptions.ContainsOption("-restartargs"))
|
||||
{
|
||||
var args = Environment.GetCommandLineArgs()
|
||||
.Skip(1)
|
||||
.Select(NormalizeCommandLineArgument);
|
||||
|
||||
commandLineArgsString = string.Join(" ", args.ToArray());
|
||||
}
|
||||
|
||||
_logger.Info("Executable: {0}", module);
|
||||
_logger.Info("Arguments: {0}", commandLineArgsString);
|
||||
|
||||
Reference in New Issue
Block a user