aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/state.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/state.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/state.go')
-rw-r--r--internal/feed/state.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/feed/state.go b/internal/feed/state.go
index 9a6f836..8efef5e 100644
--- a/internal/feed/state.go
+++ b/internal/feed/state.go
@@ -74,3 +74,11 @@ func NewState(cfg *config.Config) *State {
return &state
}
+
+func (state *State) RemoveUndue() {
+ for name, feed := range state.feeds {
+ if !feed.NeedsUpdate(feed.cached.Last()) {
+ delete(state.feeds, name)
+ }
+ }
+}