mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-25 06:57:08 -04:00
Fixed: Trimming disabled logs database
(cherry picked from commit d5dff8e8d6301b661a713702e1c476705423fc4f)
This commit is contained in:
parent
b5e6a36878
commit
10bb270da8
1 changed files with 10 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue