diff options
-rw-r--r-- | internal/feed/state.go | 4 | ||||
-rw-r--r-- | main.go | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/internal/feed/state.go b/internal/feed/state.go index 8efef5e..2a0a1e1 100644 --- a/internal/feed/state.go +++ b/internal/feed/state.go @@ -82,3 +82,7 @@ func (state *State) RemoveUndue() { } } } + +func (state *State) NumFeeds() int { + return len(state.feeds) +} @@ -68,6 +68,11 @@ func run() error { state.RemoveUndue() + if state.NumFeeds() == 0 { + // nothing to do + return nil + } + if success := state.Fetch(); success == 0 { return fmt.Errorf("No successfull feed fetch.") } |