mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
26 lines
581 B
C#
26 lines
581 B
C#
using Dapper;
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
{
|
|
public class TrimHttpCache : IHousekeepingTask
|
|
{
|
|
private readonly ICacheDatabase _database;
|
|
|
|
public TrimHttpCache(ICacheDatabase database)
|
|
{
|
|
_database = database;
|
|
}
|
|
|
|
public void Clean()
|
|
{
|
|
using (var mapper = _database.OpenConnection())
|
|
{
|
|
mapper.Execute(@"DELETE FROM HttpResponse WHERE Expiry < date('now')");
|
|
}
|
|
|
|
_database.Vacuum();
|
|
}
|
|
}
|
|
}
|