weed/mount: simplify metadata flush retry returns (#8763)
This commit is contained in:
@@ -12,10 +12,10 @@ func retryMetadataFlush(flush func() error, onRetry func(nextAttempt, totalAttem
|
|||||||
for attempt := 1; attempt <= totalAttempts; attempt++ {
|
for attempt := 1; attempt <= totalAttempts; attempt++ {
|
||||||
err = flush()
|
err = flush()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
break
|
||||||
}
|
}
|
||||||
if attempt == totalAttempts {
|
if attempt == totalAttempts {
|
||||||
return err
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
backoff := time.Duration(1<<uint(attempt-1)) * time.Second
|
backoff := time.Duration(1<<uint(attempt-1)) * time.Second
|
||||||
|
|||||||
Reference in New Issue
Block a user