mirror of
https://github.com/miniflux/v2.git
synced 2025-08-26 18:21:01 +00:00
refactor(http): use time.Duration for refresh interval
It's not clear which units of time used for refresh interval. Convert to time.Duration for clarity.
This commit is contained in:
parent
30453ad7ec
commit
c6536e8d90
6 changed files with 26 additions and 15 deletions
|
@ -784,12 +784,22 @@ func TestForceRefreshInterval(t *testing.T) {
|
|||
t.Fatalf(`Parsing failure: %v`, err)
|
||||
}
|
||||
|
||||
expected := 42
|
||||
expected := 42 * time.Second
|
||||
result := opts.ForceRefreshInterval()
|
||||
|
||||
if result != expected {
|
||||
t.Fatalf(`Unexpected FORCE_REFRESH_INTERVAL value, got %v instead of %v`, result, expected)
|
||||
}
|
||||
|
||||
sorted := opts.SortedOptions(false)
|
||||
i := slices.IndexFunc(sorted, func(opt *option) bool {
|
||||
return opt.Key == "FORCE_REFRESH_INTERVAL"
|
||||
})
|
||||
|
||||
expectedSerialized := 42
|
||||
if got := sorted[i].Value; got != expectedSerialized {
|
||||
t.Fatalf(`Unexpected value in option output, got %q instead of %q`, got, expectedSerialized)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultBatchSizeValue(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue