diff --git a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs index 1e62b6580..ccca19073 100644 --- a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs +++ b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs @@ -16,12 +16,11 @@ public class DatabaseTarget : TargetWithLayout, IHandle trayCallback = null Logger.Info(ex.Message); LogManager.Configuration = null; } + + // Make sure there are no lingering database connections + GC.Collect(); + GC.WaitForPendingFinalizers(); + SQLiteConnection.ClearAllPools(); } public static IHostBuilder CreateConsoleHostBuilder(string[] args, StartupContext context)