Fixed Exceptioneer, Launcher should run as priority normal

This commit is contained in:
kay.one 2011-07-03 22:03:05 -07:00
parent c753b315d8
commit badcfecb93
5 changed files with 19 additions and 18 deletions

View file

@ -12,21 +12,25 @@ namespace NzbDrone
private static void Main()
{
Logger.Info(Process.GetCurrentProcess().Id);
try
{
Config.ConfigureNlog();
Logger.Info("Starting NZBDrone. Start-up Path:'{0}'", Config.ProjectRoot);
Thread.CurrentThread.Name = "Host";
Process currentProcess = Process.GetCurrentProcess();
if (currentProcess.PriorityClass < ProcessPriorityClass.Normal)
{
Logger.Info("Promoting process priority from {0} to {1}", currentProcess.PriorityClass, ProcessPriorityClass.Normal);
currentProcess.PriorityClass = ProcessPriorityClass.Normal;
}
currentProcess.EnableRaisingEvents = true;
currentProcess.Exited += ProgramExited;
AppDomain.CurrentDomain.UnhandledException += ((s, e) => AppDomainException(e));
AppDomain.CurrentDomain.ProcessExit += ProgramExited;
AppDomain.CurrentDomain.DomainUnload += ProgramExited;
Process.GetCurrentProcess().EnableRaisingEvents = true;
Process.GetCurrentProcess().Exited += ProgramExited;
Config.ConfigureNlog();
Logger.Info("Starting NZBDrone. Start-up Path:'{0}'", Config.ProjectRoot);
IISController.StopServer();
IISController.StartServer();