moved log to object db.

This commit is contained in:
kay.one 2013-02-23 11:38:25 -08:00
commit b3c6db5997
21 changed files with 157 additions and 321 deletions

View file

@ -0,0 +1,25 @@
using System;
using System.Linq;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Instrumentation
{
public interface ILogRepository : IBasicRepository<Log>
{
void Trim();
}
public class LogRepository : BasicRepository<Log>, ILogRepository
{
public LogRepository(IObjectDatabase objectDatabase)
: base(objectDatabase)
{
}
public void Trim()
{
var oldIds = Queryable.Where(c => c.Time < DateTime.Now.AddDays(-30).Date).Select(c => c.OID);
DeleteMany(oldIds);
}
}
}