Commit 1d9f7545 authored by forrestchen's avatar forrestchen

no need to sleep for last retry

parent f9707a7d
...@@ -58,6 +58,9 @@ func waitForPathToExistInternal(devicePath string, maxRetries int, deviceTranspo ...@@ -58,6 +58,9 @@ func waitForPathToExistInternal(devicePath string, maxRetries int, deviceTranspo
if err != nil && !os.IsNotExist(err) { if err != nil && !os.IsNotExist(err) {
return false return false
} }
if i == maxRetries-1 {
break
}
time.Sleep(time.Second) time.Sleep(time.Second)
} }
return false return false
......
...@@ -84,6 +84,9 @@ func waitForPath(pool, image string, maxRetries int) (string, bool) { ...@@ -84,6 +84,9 @@ func waitForPath(pool, image string, maxRetries int) (string, bool) {
if found { if found {
return devicePath, true return devicePath, true
} }
if i == maxRetries-1 {
break
}
time.Sleep(time.Second) time.Sleep(time.Second)
} }
return "", false return "", false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment