1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Add FORCE_REFRESH_INTERVAL config option

This commit is contained in:
notsmarthuman 2024-01-03 02:33:15 +00:00 committed by GitHub
parent a1879ea37c
commit 4590da2fc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 126 additions and 20 deletions

View file

@ -759,6 +759,41 @@ func TestPollingFrequency(t *testing.T) {
}
}
func TestDefautForceRefreshInterval(t *testing.T) {
os.Clearenv()
parser := NewParser()
opts, err := parser.ParseEnvironmentVariables()
if err != nil {
t.Fatalf(`Parsing failure: %v`, err)
}
expected := defaultForceRefreshInterval
result := opts.ForceRefreshInterval()
if result != expected {
t.Fatalf(`Unexpected FORCE_REFRESH_INTERVAL value, got %v instead of %v`, result, expected)
}
}
func TestForceRefreshInterval(t *testing.T) {
os.Clearenv()
os.Setenv("FORCE_REFRESH_INTERVAL", "42")
parser := NewParser()
opts, err := parser.ParseEnvironmentVariables()
if err != nil {
t.Fatalf(`Parsing failure: %v`, err)
}
expected := 42
result := opts.ForceRefreshInterval()
if result != expected {
t.Fatalf(`Unexpected FORCE_REFRESH_INTERVAL value, got %v instead of %v`, result, expected)
}
}
func TestDefaultBatchSizeValue(t *testing.T) {
os.Clearenv()