debounce parsing after first event in watch

This commit is contained in:
Chakib Ben Ziane 2018-06-14 15:55:15 +02:00
parent d64e3055f9
commit 8898362d73

View File

@ -23,7 +23,9 @@ func debouncer(interval time.Duration, input chan fsnotify.Event, w IWatchable)
if !isResting {
// Run the job
//log.Debug("Not resting, running job")
w.Run()
time.AfterFunc(1*time.Second, func() {
w.Run()
})
//log.Debug("Restting timer")
timer.Reset(interval)
//log.Debug("Is resting now")