mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -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,6 +1,4 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
|
||||
|
@ -20,8 +18,8 @@ namespace NzbDrone.Core.Instrumentation
|
|||
|
||||
public void Trim()
|
||||
{
|
||||
var oldIds = Query.Where(c => c.Time < DateTime.UtcNow.AddDays(-30).Date).Select(c => c.Id);
|
||||
DeleteMany(oldIds);
|
||||
var trimDate = DateTime.UtcNow.AddDays(-15).Date;
|
||||
Delete(c => c.Time <= trimDate);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue