mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
moved log to object db.
This commit is contained in:
parent
71dcd623f7
commit
b3c6db5997
21 changed files with 157 additions and 321 deletions
25
NzbDrone.Core/Instrumentation/LogRepository.cs
Normal file
25
NzbDrone.Core/Instrumentation/LogRepository.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue