mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Fixed: Trimming disabled logs database
(cherry picked from commit d5dff8e8d6301b661a713702e1c476705423fc4f)
This commit is contained in:
parent
b5e6a36878
commit
10bb270da8
@ -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…
Reference in New Issue
Block a user