mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 00:34:37 +02:00
fixed NzbDrone using 100% cpu when console not available.
This commit is contained in:
@@ -7,8 +7,6 @@ namespace NzbDrone.Common
|
||||
{
|
||||
public interface IConsoleService
|
||||
{
|
||||
bool IsConsoleApplication { get; }
|
||||
void WaitForClose();
|
||||
void PrintHelp();
|
||||
void PrintServiceAlreadyExist();
|
||||
void PrintServiceDoesNotExist();
|
||||
@@ -16,26 +14,18 @@ namespace NzbDrone.Common
|
||||
|
||||
public class ConsoleService : IConsoleService
|
||||
{
|
||||
public bool IsConsoleApplication
|
||||
public static bool IsConsoleAvailable
|
||||
{
|
||||
get { return Console.In != StreamReader.Null; }
|
||||
}
|
||||
|
||||
public void WaitForClose()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
public void PrintHelp()
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(" Usage: {0} <command> ", Process.GetCurrentProcess().MainModule.ModuleName);
|
||||
Console.WriteLine(" Commands:");
|
||||
Console.WriteLine(" /{0} Install the application as a Windows Service ({1}).",StartupArguments.INSTALL_SERVICE, ServiceProvider.NZBDRONE_SERVICE_NAME);
|
||||
Console.WriteLine(" /{0} Uninstall already installed Windows Service ({1}).",StartupArguments.UNINSTALL_SERVICE, ServiceProvider.NZBDRONE_SERVICE_NAME);
|
||||
Console.WriteLine(" /{0} Install the application as a Windows Service ({1}).", StartupArguments.INSTALL_SERVICE, ServiceProvider.NZBDRONE_SERVICE_NAME);
|
||||
Console.WriteLine(" /{0} Uninstall already installed Windows Service ({1}).", StartupArguments.UNINSTALL_SERVICE, ServiceProvider.NZBDRONE_SERVICE_NAME);
|
||||
Console.WriteLine(" /{0} Don't open NzbDrone in a browser", StartupArguments.NO_BROWSER);
|
||||
Console.WriteLine(" <No Arguments> Run application in console mode.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user