accounts/keystore: Ignore initial trigger of rescan-event

This commit is contained in:
Martin Holst Swende 2017-11-20 12:35:30 +01:00
parent 0f184d3b14
commit e2b3a23663
No known key found for this signature in database
GPG Key ID: 683B438C05A5DDF0

View File

@ -81,10 +81,14 @@ func (w *watcher) loop() {
// When an event occurs, the reload call is delayed a bit so that
// multiple events arriving quickly only cause a single reload.
var (
debounce = time.NewTimer(0)
debounceDuration = 500 * time.Millisecond
rescanTriggered = false
debounce = time.NewTimer(0)
)
// Ignore initial trigger
if !debounce.Stop() {
<-debounce.C
}
defer debounce.Stop()
for {
select {