Skip to content

Commit

Permalink
fix goroutine leak on fetch sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
buzyakabarbuzyaka authored and eikenb committed Sep 29, 2022
1 parent 7e3c9ba commit c677df8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dependency/vault_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ func (d *VaultReadQuery) Fetch(clients *ClientSet, opts *QueryOptions,
}
select {
case dur := <-d.sleepCh:
time.Sleep(dur)
select {
case <-time.After(dur):
break
case <-d.stopCh:
return nil, nil, ErrStopped
}
default:
}

Expand Down

0 comments on commit c677df8

Please sign in to comment.