Skip to content

Commit

Permalink
Sleep 50ms after every file watch loop
Browse files Browse the repository at this point in the history
This prevents CPU churn
  • Loading branch information
crabmusket committed Apr 26, 2019
1 parent 62012ce commit ea89548
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (fw *Watcher) watchRoutine(tick <-chan time.Time, stop chan bool, handler W
}
default:
}
time.Sleep(50 * time.Millisecond)
}
}

Expand Down

0 comments on commit ea89548

Please sign in to comment.