mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-05 21:33:02 +02:00
update mono restart
This commit is contained in:
parent
d9c4775015
commit
609d1f19cc
|
@ -23,7 +23,7 @@ namespace MediaBrowser.Server.Mono
|
|||
|
||||
private static ILogger _logger;
|
||||
|
||||
public static void Main (string[] args)
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var applicationPath = Assembly.GetEntryAssembly().Location;
|
||||
|
||||
|
@ -81,26 +81,27 @@ namespace MediaBrowser.Server.Mono
|
|||
|
||||
_appHost = new ApplicationHost(appPaths, logManager, options, fileSystem, "MBServer.Mono", nativeApp);
|
||||
|
||||
if (options.ContainsOption("-v")) {
|
||||
Console.WriteLine (_appHost.ApplicationVersion.ToString());
|
||||
if (options.ContainsOption("-v"))
|
||||
{
|
||||
Console.WriteLine(_appHost.ApplicationVersion.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine ("appHost.Init");
|
||||
Console.WriteLine("appHost.Init");
|
||||
|
||||
var initProgress = new Progress<double>();
|
||||
|
||||
var task = _appHost.Init(initProgress);
|
||||
Task.WaitAll (task);
|
||||
Task.WaitAll(task);
|
||||
|
||||
Console.WriteLine ("Running startup tasks");
|
||||
Console.WriteLine("Running startup tasks");
|
||||
|
||||
task = _appHost.RunStartupTasks();
|
||||
Task.WaitAll (task);
|
||||
Task.WaitAll(task);
|
||||
|
||||
task = ApplicationTaskCompletionSource.Task;
|
||||
|
||||
Task.WaitAll (task);
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -135,7 +136,7 @@ namespace MediaBrowser.Server.Mono
|
|||
|
||||
public static void Shutdown()
|
||||
{
|
||||
ApplicationTaskCompletionSource.SetResult (true);
|
||||
ApplicationTaskCompletionSource.SetResult(true);
|
||||
}
|
||||
|
||||
public static void Restart()
|
||||
|
@ -145,14 +146,17 @@ namespace MediaBrowser.Server.Mono
|
|||
|
||||
_logger.Info("Starting new instance");
|
||||
|
||||
var currentProcess = Process.GetCurrentProcess();
|
||||
|
||||
var args = Environment.GetCommandLineArgs()
|
||||
.Skip(1)
|
||||
.Select(NormalizeCommandLineArgument);
|
||||
|
||||
var commandLineArgsString = string.Join(" ", args.ToArray());
|
||||
var module = Environment.GetCommandLineArgs().First();
|
||||
|
||||
Process.Start(currentProcess.MainModule.FileName, commandLineArgsString);
|
||||
_logger.Info("Executable: {0}", module);
|
||||
_logger.Info("Arguments: {0}", commandLineArgsString);
|
||||
|
||||
Process.Start(module, commandLineArgsString);
|
||||
|
||||
_logger.Info("Calling Environment.Exit");
|
||||
Environment.Exit(0);
|
||||
|
@ -171,7 +175,7 @@ namespace MediaBrowser.Server.Mono
|
|||
|
||||
class NoCheckCertificatePolicy : ICertificatePolicy
|
||||
{
|
||||
public bool CheckValidationResult (ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
|
||||
public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue