Fixed: Trimming disabled logs database

(cherry picked from commit d5dff8e8d6301b661a713702e1c476705423fc4f)
pull/2168/head
Bogdan 6 months ago
parent 220ef723c7
commit 4bcaba0be0

@ -1,18 +1,26 @@
using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Instrumentation;
namespace NzbDrone.Core.Housekeeping.Housekeepers namespace NzbDrone.Core.Housekeeping.Housekeepers
{ {
public class TrimLogDatabase : IHousekeepingTask public class TrimLogDatabase : IHousekeepingTask
{ {
private readonly ILogRepository _logRepo; private readonly ILogRepository _logRepo;
private readonly IConfigFileProvider _configFileProvider;
public TrimLogDatabase(ILogRepository logRepo) public TrimLogDatabase(ILogRepository logRepo, IConfigFileProvider configFileProvider)
{ {
_logRepo = logRepo; _logRepo = logRepo;
_configFileProvider = configFileProvider;
} }
public void Clean() public void Clean()
{ {
if (!_configFileProvider.LogDbEnabled)
{
return;
}
_logRepo.Trim(); _logRepo.Trim();
} }
} }

Loading…
Cancel
Save