mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 18:42:42 +01:00
added some logging to shutdown process.
This commit is contained in:
parent
89e83ded04
commit
02fab62811
@ -29,6 +29,8 @@ public static void Main(string[] args)
|
||||
//Need this to terminate on mono (thanks nlog)
|
||||
LogManager.Configuration = null;
|
||||
}
|
||||
|
||||
Logger.Info("Exiting main.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Threading;
|
||||
using NLog;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Processes;
|
||||
|
||||
@ -13,11 +14,13 @@ public class SpinService : IWaitForExit
|
||||
{
|
||||
private readonly IRuntimeInfo _runtimeInfo;
|
||||
private readonly IProcessProvider _processProvider;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public SpinService(IRuntimeInfo runtimeInfo, IProcessProvider processProvider)
|
||||
public SpinService(IRuntimeInfo runtimeInfo, IProcessProvider processProvider, Logger logger)
|
||||
{
|
||||
_runtimeInfo = runtimeInfo;
|
||||
_processProvider = processProvider;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Spin()
|
||||
@ -27,8 +30,11 @@ public void Spin()
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
_logger.Debug("wait loop was terminated.");
|
||||
|
||||
if (_runtimeInfo.RestartPending)
|
||||
{
|
||||
_logger.Info("attemptig restart.");
|
||||
_processProvider.SpawnNewProcess(_runtimeInfo.ExecutingApplication, "--restart --nobrowser");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user