|
|
@ -1,4 +1,4 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
@ -10,6 +10,7 @@ namespace NzbDrone.Host
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void PreventStartIfAlreadyRunning();
|
|
|
|
void PreventStartIfAlreadyRunning();
|
|
|
|
void KillAllOtherInstance();
|
|
|
|
void KillAllOtherInstance();
|
|
|
|
|
|
|
|
void WarnIfAlreadyRunning();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class SingleInstancePolicy : ISingleInstancePolicy
|
|
|
|
public class SingleInstancePolicy : ISingleInstancePolicy
|
|
|
@ -45,6 +46,14 @@ namespace NzbDrone.Host
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void WarnIfAlreadyRunning()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (IsAlreadyRunning())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Debug("Another instance of Lidarr is already running.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool IsAlreadyRunning()
|
|
|
|
private bool IsAlreadyRunning()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return GetOtherNzbDroneProcessIds().Any();
|
|
|
|
return GetOtherNzbDroneProcessIds().Any();
|
|
|
@ -76,4 +85,4 @@ namespace NzbDrone.Host
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|