1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-22 12:07:04 +00:00

Refactor retention scanner prior to starting #12

This commit is contained in:
James Hillyerd
2017-01-22 20:59:59 -08:00
parent 62b77dfe5e
commit 32631daeae
3 changed files with 89 additions and 74 deletions

View File

@@ -36,7 +36,12 @@ func TestDoRetentionScan(t *testing.T) {
mb3.On("GetMessages").Return([]Message{new3}, nil)
// Test 4 hour retention
if err := doRetentionScan(mds, 4*time.Hour-time.Minute, 0); err != nil {
rs := &RetentionScanner{
ds: mds,
retentionPeriod: 4*time.Hour - time.Minute,
retentionSleep: 0,
}
if err := rs.doScan(); err != nil {
t.Error(err)
}