mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
added log trim command
This commit is contained in:
parent
279f8b5d73
commit
73f3459264
16 changed files with 62 additions and 69 deletions
|
@ -1,16 +1,15 @@
|
|||
using System.Linq;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Instrumentation.Commands;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
public interface ILogService
|
||||
{
|
||||
void DeleteAll();
|
||||
void Trim();
|
||||
PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec);
|
||||
}
|
||||
|
||||
public class LogService : ILogService
|
||||
public class LogService : ILogService, IExecute<TrimLogCommand>
|
||||
{
|
||||
private readonly ILogRepository _logRepository;
|
||||
|
||||
|
@ -19,19 +18,14 @@ namespace NzbDrone.Core.Instrumentation
|
|||
_logRepository = logRepository;
|
||||
}
|
||||
|
||||
public void DeleteAll()
|
||||
{
|
||||
_logRepository.Purge();
|
||||
}
|
||||
|
||||
public void Trim()
|
||||
{
|
||||
_logRepository.Trim();
|
||||
}
|
||||
|
||||
public PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec)
|
||||
{
|
||||
return _logRepository.GetPaged(pagingSpec);
|
||||
}
|
||||
|
||||
public void Execute(TrimLogCommand message)
|
||||
{
|
||||
_logRepository.Trim();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue