Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Readarr/commit/c48ce4d9e08e583345d2f74ab8286c9ed3a544a9
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
32 additions and
2 deletions
@ -109,6 +109,13 @@ namespace NzbDrone.Core.Test.InstrumentationTests
epFile . Path . Should ( ) . BeNull ( ) ;
}
[TearDown]
public void Teardown ( )
{
Mocker . Resolve < DatabaseTarget > ( ) . UnRegister ( ) ;
}
private void VerifyLog ( Log logItem , LogLevel level )
{
logItem . Time . Should ( ) . BeWithin ( TimeSpan . FromSeconds ( 2 ) ) ;
@ -3,11 +3,13 @@ using NLog.Config;
using NLog ;
using NLog.Layouts ;
using NLog.Targets ;
using NzbDrone.Common.Messaging ;
using NzbDrone.Core.Lifecycle ;
namespace NzbDrone.Core.Instrumentation
{
public class DatabaseTarget : TargetWithLayout
public class DatabaseTarget : TargetWithLayout , IHandle < ApplicationShutdownRequested >
{
private readonly ILogRepository _repository ;
@ -24,10 +26,23 @@ namespace NzbDrone.Core.Instrumentation
LogManager . Configuration . AddTarget ( "DbLogger" , this ) ;
LogManager . Configuration . LoggingRules . Add ( Rule ) ;
LogManager . ConfigurationReloaded + = ( sender , args ) = > Register ( ) ;
LogManager . ConfigurationReloaded + = OnLogManagerOnConfigurationReloaded ;
LogManager . ReconfigExistingLoggers ( ) ;
}
public void UnRegister ( )
{
LogManager . ConfigurationReloaded - = OnLogManagerOnConfigurationReloaded ;
LogManager . Configuration . RemoveTarget ( "DbLogger" ) ;
LogManager . Configuration . LoggingRules . Remove ( Rule ) ;
LogManager . ReconfigExistingLoggers ( ) ;
Dispose ( ) ;
}
private void OnLogManagerOnConfigurationReloaded ( object sender , LoggingConfigurationReloadedEventArgs args )
{
Register ( ) ;
}
public LoggingRule Rule { get ; set ; }
@ -66,5 +81,13 @@ namespace NzbDrone.Core.Instrumentation
_repository . Insert ( log ) ;
}
public void Handle ( ApplicationShutdownRequested message )
{
if ( LogManager . Configuration . LoggingRules . Contains ( Rule ) )
{
UnRegister ( ) ;
}
}
}
}