1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

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

@ -8,15 +8,14 @@ namespace NzbDrone.Core.Instrumentation
{ {
public class ExceptioneerTarget : Target public class ExceptioneerTarget : Target
{ {
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
protected override void Write(LogEventInfo logEvent) protected override void Write(LogEventInfo logEvent)
{ {
if (logEvent.Exception == null)
throw new InvalidOperationException(
@"Missing Exception Object.. Please Use Logger.FatalException() or Logger.ErrorException() rather
than Logger.Fatal() and Logger.Error()");
if (!Debugger.IsAttached) if (!Debugger.IsAttached)
{ {
Logger.Trace("Sending Exception to Exceptioneer");
new Client new Client
{ {
ApiKey = "43BBF60A-EB2A-4C1C-B09E-422ADF637265", ApiKey = "43BBF60A-EB2A-4C1C-B09E-422ADF637265",

View File

@ -24,7 +24,7 @@ public static void Setup()
public static void StartDbLogging() public static void StartDbLogging()
{ {
#if Release #if RELEASE
var exTarget = new ExceptioneerTarget(); var exTarget = new ExceptioneerTarget();
LogManager.Configuration.AddTarget("Exceptioneer", exTarget); LogManager.Configuration.AddTarget("Exceptioneer", exTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Error, exTarget)); LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Error, exTarget));

View File

@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html>
@using Helpers; @using Helpers;
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <head runat="server">
@ -61,7 +61,7 @@
<span id="msgText">background notification</span> <span id="msgText">background notification</span>
</div> </div>
@(Html.Telerik().ScriptRegistrar().jQuery(false)) @(Html.Telerik().ScriptRegistrar().jQuery(false))
<script type="text/javascript" src="/Scripts/Notification.js"></script> <script type="text/javascript" src="/Scripts/Notification.js" async="async"></script>
@RenderSection("Scripts", required: false) @RenderSection("Scripts", required: false)
</body> </body>
</html> </html>

View File

@ -71,8 +71,6 @@ internal static Process StartServer()
IISProcess.BeginErrorReadLine(); IISProcess.BeginErrorReadLine();
IISProcess.BeginOutputReadLine(); IISProcess.BeginOutputReadLine();
IISProcess.PriorityClass = ProcessPriorityClass.AboveNormal;
//Start Ping //Start Ping
_pingTimer = new Timer(300000) { AutoReset = true }; _pingTimer = new Timer(300000) { AutoReset = true };
_pingTimer.Elapsed += (PingServer); _pingTimer.Elapsed += (PingServer);

View File

@ -12,21 +12,25 @@ internal static class Program
private static void Main() private static void Main()
{ {
Logger.Info(Process.GetCurrentProcess().Id);
try try
{ {
Config.ConfigureNlog();
Logger.Info("Starting NZBDrone. Start-up Path:'{0}'", Config.ProjectRoot);
Thread.CurrentThread.Name = "Host"; 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.UnhandledException += ((s, e) => AppDomainException(e));
AppDomain.CurrentDomain.ProcessExit += ProgramExited; AppDomain.CurrentDomain.ProcessExit += ProgramExited;
AppDomain.CurrentDomain.DomainUnload += 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.StopServer();
IISController.StartServer(); IISController.StartServer();