1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Avoid excessive manual polling with default scheduler

This commit is contained in:
Frédéric Guillot 2023-10-16 21:20:58 -07:00
parent 54eb500315
commit cc44d14722
7 changed files with 40 additions and 15 deletions

View file

@ -122,7 +122,7 @@ func (f *Feed) ScheduleNextCheck(weeklyCount int) {
}
f.NextCheckAt = time.Now().Add(time.Minute * time.Duration(intervalMinutes))
default:
f.NextCheckAt = time.Now()
f.NextCheckAt = time.Now().Add(time.Minute * time.Duration(config.Opts.PollingFrequency()))
}
}

View file

@ -97,6 +97,10 @@ func TestFeedScheduleNextCheckDefault(t *testing.T) {
if feed.NextCheckAt.IsZero() {
t.Error(`The next_check_at must be set`)
}
if feed.NextCheckAt.After(time.Now().Add(time.Minute * time.Duration(config.Opts.PollingFrequency()))) {
t.Error(`The next_check_at should not be after the now + polling frequency`)
}
}
func TestFeedScheduleNextCheckEntryCountBasedMaxInterval(t *testing.T) {