From 883101cbf04ed87ff1bfd228f06a0040ee53543c Mon Sep 17 00:00:00 2001 From: Tim Anema Date: Tue, 11 Oct 2016 16:20:47 -0400 Subject: [PATCH 1/2] took out bad debounce logic --- kit/file_watcher.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kit/file_watcher.go b/kit/file_watcher.go index 954c82ca..4db54509 100644 --- a/kit/file_watcher.go +++ b/kit/file_watcher.go @@ -146,14 +146,10 @@ func convertFsEvents(events chan fsnotify.Event, filter eventFilter) chan AssetE var currentEvent fsnotify.Event recordedEvents := map[string]fsnotify.Event{} for { - currentEvent = <-events - if currentEvent.Op&fsnotify.Chmod != fsnotify.Chmod { - recordedEvents[currentEvent.Name] = currentEvent - } select { case currentEvent = <-events: if currentEvent.Op&fsnotify.Chmod == fsnotify.Chmod { - continue + currentEvent.Op = fsnotify.Write } recordedEvents[currentEvent.Name] = currentEvent case <-time.After(debounceTimeout): From cb3a0e676c77fe141a54282d386333d2f75b5f55 Mon Sep 17 00:00:00 2001 From: Tim Anema Date: Tue, 11 Oct 2016 16:23:47 -0400 Subject: [PATCH 2/2] lower timout on debouncing so that the timeout isn't running so much and will filter out more events --- kit/file_watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kit/file_watcher.go b/kit/file_watcher.go index 4db54509..87c9b6f7 100644 --- a/kit/file_watcher.go +++ b/kit/file_watcher.go @@ -13,7 +13,7 @@ import ( ) const ( - debounceTimeout = 50 * time.Millisecond + debounceTimeout = 500 * time.Millisecond ) var (