Fixed import count updates

This commit is contained in:
Philipp Wolfer 2023-11-21 19:05:06 +01:00
parent 56eae67292
commit 08876a2d70
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
4 changed files with 4 additions and 5 deletions

View file

@ -134,7 +134,7 @@ func (i *ImportResult) UpdateTimestamp(newTime time.Time) {
func (i *ImportResult) Update(from ImportResult) {
i.TotalCount = from.TotalCount
i.ImportCount += from.ImportCount
i.ImportCount = from.ImportCount
i.UpdateTimestamp(from.LastTimestamp)
}

View file

@ -90,7 +90,7 @@ func TestImportResultUpdate(t *testing.T) {
}
result.Update(newResult)
assert.Equal(t, 120, result.TotalCount)
assert.Equal(t, 70, result.ImportCount)
assert.Equal(t, 50, result.ImportCount)
assert.Equal(t, newResult.LastTimestamp, result.LastTimestamp)
}