mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 23:57:20 +02:00
New: Log database is compressed when logs are trimmed/purged
This commit is contained in:
parent
9370de0cc0
commit
a0b0f586c8
@ -80,14 +80,14 @@ public void UpdateMappings_should_not_delete_if_fetch_returns_empty_list()
|
|||||||
private void AssertNoUpdate()
|
private void AssertNoUpdate()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ISceneMappingProxy>().Verify(c => c.Fetch(), Times.Once());
|
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());
|
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.InsertMany(_fakeMappings), Times.Never());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AssertMappingUpdated()
|
private void AssertMappingUpdated()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<ISceneMappingProxy>().Verify(c => c.Fetch(), Times.Once());
|
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());
|
Mocker.GetMock<ISceneMappingRepository>().Verify(c => c.InsertMany(_fakeMappings), Times.Once());
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ public void Trim()
|
|||||||
{
|
{
|
||||||
var trimDate = DateTime.UtcNow.AddDays(-7).Date;
|
var trimDate = DateTime.UtcNow.AddDays(-7).Date;
|
||||||
Delete(c => c.Time <= trimDate);
|
Delete(c => c.Time <= trimDate);
|
||||||
|
Vacuum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,7 +30,7 @@ public void Execute(TrimLogCommand message)
|
|||||||
|
|
||||||
public void Execute(ClearLogCommand message)
|
public void Execute(ClearLogCommand message)
|
||||||
{
|
{
|
||||||
_logRepository.Purge();
|
_logRepository.Purge(vacuum: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user