1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-02 06:31:51 +02:00
Sonarr/NzbDrone.Core/Instrumentation/LogRepository.cs

26 lines
610 B
C#
Raw Normal View History

2013-02-23 22:38:25 +03:00
using System;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
2013-09-11 09:33:47 +03:00
2013-02-23 22:38:25 +03:00
namespace NzbDrone.Core.Instrumentation
{
public interface ILogRepository : IBasicRepository<Log>
{
void Trim();
}
public class LogRepository : BasicRepository<Log>, ILogRepository
{
public LogRepository(IDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
2013-02-23 22:38:25 +03:00
{
}
public void Trim()
{
var trimDate = DateTime.UtcNow.AddDays(-7).Date;
2013-06-19 04:01:08 +03:00
Delete(c => c.Time <= trimDate);
2013-02-23 22:38:25 +03:00
}
}
}