no need to sleep for last retry

Signed-off-by: forrestchen <forrestchen@tencent.com>
pull/6/head
forrestchen 2016-12-21 17:52:01 +08:00
parent f9707a7d9b
commit 1d9f754565
2 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,9 @@ func waitForPathToExistInternal(devicePath string, maxRetries int, deviceTranspo
if err != nil && !os.IsNotExist(err) {
return false
}
if i == maxRetries-1 {
break
}
time.Sleep(time.Second)
}
return false

View File

@ -84,6 +84,9 @@ func waitForPath(pool, image string, maxRetries int) (string, bool) {
if found {
return devicePath, true
}
if i == maxRetries-1 {
break
}
time.Sleep(time.Second)
}
return "", false