mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-01-04 15:54:33 +00:00
New: Log database is compressed when logs are trimmed/purged
This commit is contained in:
@@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test.DataAugmentationFixture.Scene
|
||||
_fakeMappings[4].ParseTerm = "Cleaned";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public void UpdateMappings_purge_existing_mapping_and_add_new_ones()
|
||||
@@ -80,14 +80,14 @@ namespace NzbDrone.Core.Test.DataAugmentationFixture.Scene
|
||||
private void AssertNoUpdate()
|
||||
{
|
||||
Mocker.GetMock<ISceneMappingProxy>().Verify(c => c.Fetch(), Times.Once());
|
||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.Purge(), Times.Never());
|
||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.Purge(It.IsAny<bool>()), Times.Never());
|
||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.InsertMany(_fakeMappings), Times.Never());
|
||||
}
|
||||
|
||||
private void AssertMappingUpdated()
|
||||
{
|
||||
Mocker.GetMock<ISceneMappingProxy>().Verify(c => c.Fetch(), Times.Once());
|
||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.Purge(), Times.Once());
|
||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.Purge(It.IsAny<bool>()), Times.Once());
|
||||
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.InsertMany(_fakeMappings), Times.Once());
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
var trimDate = DateTime.UtcNow.AddDays(-7).Date;
|
||||
Delete(c => c.Time <= trimDate);
|
||||
Vacuum();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace NzbDrone.Core.Instrumentation
|
||||
|
||||
public void Execute(ClearLogCommand message)
|
||||
{
|
||||
_logRepository.Purge();
|
||||
_logRepository.Purge(vacuum: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user