Fixed: Trimming disabled logs database

(cherry picked from commit d5dff8e8d6301b661a713702e1c476705423fc4f)
pull/4879/head
Bogdan 5 months ago committed by servarr
parent bc19ead182
commit ef50a0c326

@ -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