You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
792 B
32 lines
792 B
using NzbDrone.Core.Datastore;
|
|
using NzbDrone.Core.Instrumentation.Commands;
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
namespace NzbDrone.Core.Instrumentation
|
|
{
|
|
public interface ILogService
|
|
{
|
|
PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec);
|
|
}
|
|
|
|
public class LogService : ILogService, IExecute<ClearLogCommand>
|
|
{
|
|
private readonly ILogRepository _logRepository;
|
|
|
|
public LogService(ILogRepository logRepository)
|
|
{
|
|
_logRepository = logRepository;
|
|
}
|
|
|
|
public PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec)
|
|
{
|
|
return _logRepository.GetPaged(pagingSpec);
|
|
}
|
|
|
|
public void Execute(ClearLogCommand message)
|
|
{
|
|
_logRepository.Purge(vacuum: true);
|
|
}
|
|
}
|
|
}
|