diff options
| author | davy wybiral <davy.wybiral@gmail.com> | 2019-08-08 06:04:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-08 06:04:39 -0500 |
| commit | 6b09ccd9d885a3230a197f7d42fa1fcc760a25ef (patch) | |
| tree | 39bbbb55e489989c0c89ed9af2e45d7eaf6d1fd1 /pkg/app/watcher.go | |
| parent | 02762c812ccd692d61328bc76029b9cc01ed8bb4 (diff) | |
cache rss feed (#19)v0.2.0
Diffstat (limited to 'pkg/app/watcher.go')
| -rw-r--r-- | pkg/app/watcher.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) } |
