aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-25 17:50:12 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-25 17:51:42 +0200
commit60ff245e6d965785d54a212b2a4ddd9b16159460 (patch)
treef07bf776739213447f616901e1803fdd65845da5 /internal/feed/feed.go
parent8c134b0ece0da2d774e2bad4df35803d3c30f500 (diff)
downloadfeed2imap-go-60ff245e6d965785d54a212b2a4ddd9b16159460.tar.gz
feed2imap-go-60ff245e6d965785d54a212b2a4ddd9b16159460.tar.bz2
feed2imap-go-60ff245e6d965785d54a212b2a4ddd9b16159460.zip
Remove undue feeds
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r--internal/feed/feed.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index d087d3a..4ee2875 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -34,7 +34,10 @@ func (feed *Feed) descriptor() feedDescriptor {
}
func (feed *Feed) NeedsUpdate(updateTime time.Time) bool {
- if !updateTime.IsZero() && int(time.Since(updateTime).Hours()) >= *feed.MinFreq {
+ if *feed.MinFreq == 0 { // shortcut
+ return true
+ }
+ if !updateTime.IsZero() && int(time.Since(updateTime).Hours()) < *feed.MinFreq {
log.Printf("Feed '%s' does not need updating, skipping.", feed.Name)
return false
}