Update drivers/docker/fingerprint.go

Co-Authored-By: Mahmood Ali <mahmood@notnoop.com>
This commit is contained in:
Yoan Blanc 2020-03-30 22:11:42 +02:00 committed by GitHub
parent 139a0ae451
commit c9f6cf385a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -62,12 +62,7 @@ func (d *Driver) handleFingerprint(ctx context.Context, ch chan *drivers.Fingerp
defer close(ch)
ticker := time.NewTimer(0)
defer func() {
// Ensures that the channel is empty by stopping and draining the ticker.
if !ticker.Stop() {
<-ticker.C
}
}()
defer ticker.Stop()
for {
select {