Skip to content

Commit

Permalink
Merge pull request #222 from Shopify/revert_bad_debounce
Browse files Browse the repository at this point in the history
Took out bad debounce logic
  • Loading branch information
tanema authored Oct 11, 2016
2 parents 5c2d27b + cb3a0e6 commit 7a60f02
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kit/file_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
debounceTimeout = 50 * time.Millisecond
debounceTimeout = 500 * time.Millisecond
)

var (
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 7a60f02

Please sign in to comment.