mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
Attach to debugger is a lot more reliable.
Added system/config ui rss job only runs enabled jobs fixed wrong mappings for indexers in settingscontroller
This commit is contained in:
parent
8ec72ed432
commit
fd32a04d45
9 changed files with 89 additions and 41 deletions
|
@ -30,22 +30,16 @@ namespace NzbDrone
|
|||
IISController.StopServer();
|
||||
IISController.StartServer();
|
||||
|
||||
Process.Start(IISController.AppUrl);
|
||||
|
||||
|
||||
#if DEBUG
|
||||
//Manually Attach debugger to IISExpress
|
||||
if (Debugger.IsAttached)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessAttacher.Attach();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Warn("Unable to attach to debugger", e);
|
||||
}
|
||||
}
|
||||
Attach();
|
||||
#endif
|
||||
|
||||
Process.Start(IISController.AppUrl);
|
||||
|
||||
IISController.IISProcess.WaitForExit();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -54,6 +48,38 @@ namespace NzbDrone
|
|||
|
||||
}
|
||||
|
||||
private static void Attach()
|
||||
{
|
||||
if (Debugger.IsAttached)
|
||||
{
|
||||
Logger.Info("Trying to attach to debugger");
|
||||
|
||||
var count = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessAttacher.Attach();
|
||||
Logger.Info("Debugger Attached");
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
count++;
|
||||
if (count > 20)
|
||||
{
|
||||
Logger.WarnException("Unable to attach to debugger", e);
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.Sleep(100);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void AppDomainException(object excepion)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue