diff --git a/src/NzbDrone.Host/Bootstrap.cs b/src/NzbDrone.Host/Bootstrap.cs index 5fdb487de3..2baf8c3d50 100644 --- a/src/NzbDrone.Host/Bootstrap.cs +++ b/src/NzbDrone.Host/Bootstrap.cs @@ -88,11 +88,15 @@ private static void EnsureSingleInstance(bool isService, IStartupContext startup { var instancePolicy = _container.Resolve(); - if (isService) + if (startupContext.Flags.Contains(StartupContext.TERMINATE)) { instancePolicy.KillAllOtherInstance(); } - else if (startupContext.Flags.Contains(StartupContext.TERMINATE)) + else if (startupContext.Args.ContainsKey(StartupContext.APPDATA)) + { + instancePolicy.WarnIfAlreadyRunning(); + } + else if (isService) { instancePolicy.KillAllOtherInstance(); } diff --git a/src/NzbDrone.Host/SingleInstancePolicy.cs b/src/NzbDrone.Host/SingleInstancePolicy.cs index 8aa3a15dd8..1978c50e68 100644 --- a/src/NzbDrone.Host/SingleInstancePolicy.cs +++ b/src/NzbDrone.Host/SingleInstancePolicy.cs @@ -10,6 +10,7 @@ public interface ISingleInstancePolicy { void PreventStartIfAlreadyRunning(); void KillAllOtherInstance(); + void WarnIfAlreadyRunning(); } public class SingleInstancePolicy : ISingleInstancePolicy @@ -45,6 +46,14 @@ public void KillAllOtherInstance() } } + public void WarnIfAlreadyRunning() + { + if (IsAlreadyRunning()) + { + _logger.Debug("Another instance of Radarr is already running."); + } + } + private bool IsAlreadyRunning() { return GetOtherNzbDroneProcessIds().Any(); @@ -64,16 +73,16 @@ private List GetOtherNzbDroneProcessIds() if (otherProcesses.Any()) { - _logger.Info("{0} instance(s) of Sonarr are running", otherProcesses.Count); + _logger.Info("{0} instance(s) of Radarr are running", otherProcesses.Count); } return otherProcesses; } catch (Exception ex) { - _logger.Warn(ex, "Failed to check for multiple instances of Sonarr."); + _logger.Warn(ex, "Failed to check for multiple instances of Radarr."); return new List(); } } } -} \ No newline at end of file +}