wintun: don't retry when not creating
The only time we're trying to counteract the race condition is when we're creating a driver. When we're simply looking up all drivers, it doesn't make sense to retry.
This commit is contained in:
parent
247e14693a
commit
46dbf54040
2 changed files with 26 additions and 9 deletions
|
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
numRetries = 100
|
||||
numRetries = 100
|
||||
retryTimeout = 150 * time.Millisecond
|
||||
)
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ func registryOpenKeyRetry(k registry.Key, path string, access uint32) (key regis
|
|||
if err == nil {
|
||||
break
|
||||
}
|
||||
if i != numRetries - 1 {
|
||||
if i != numRetries-1 {
|
||||
time.Sleep(retryTimeout)
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ func keyGetStringValueRetry(k registry.Key, name string) (val string, valtype ui
|
|||
if err == nil {
|
||||
break
|
||||
}
|
||||
if i != numRetries - 1 {
|
||||
if i != numRetries-1 {
|
||||
time.Sleep(retryTimeout)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue