From 6b09ccd9d885a3230a197f7d42fa1fcc760a25ef Mon Sep 17 00:00:00 2001 From: davy wybiral Date: Thu, 8 Aug 2019 06:04:39 -0500 Subject: cache rss feed (#19) --- pkg/app/watcher.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/app/watcher.go') diff --git a/pkg/app/watcher.go b/pkg/app/watcher.go index 2d7a761..624e470 100644 --- a/pkg/app/watcher.go +++ b/pkg/app/watcher.go @@ -36,6 +36,7 @@ func startWatcher(a *App) { // reset timer timer.Reset(debounceTimeout) case <-timer.C: + eventCount := len(removeEvents) + len(addEvents) // handle remove events first if len(removeEvents) > 0 { for p := range removeEvents { @@ -52,6 +53,9 @@ func startWatcher(a *App) { // clear map addEvents = make(map[string]struct{}) } + if eventCount > 0 { + buildFeed(a) + } // reset timer timer.Reset(debounceTimeout) } -- cgit v1.2.3