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:
parent
54eb500315
commit
cc44d14722
7 changed files with 40 additions and 15 deletions
|
@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue