mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-23 22:40:39 +02:00
weed/mount: simplify metadata flush retry returns (#8763)
This commit is contained in:
1 parent
cca1555cc7
commit
6c35a3724a
1 file changed
+2
-2
@@ -12,10 +12,10 @@ func retryMetadataFlush(flush func() error, onRetry func(nextAttempt, totalAttem
|
||||
for attempt := 1; attempt <= totalAttempts; attempt++ {
|
||||
err = flush()
|
||||
if err == nil {
|
||||
return nil
|
||||
break
|
||||
}
|
||||
if attempt == totalAttempts {
|
||||
return err
|
||||
break
|
||||
}
|
||||
|
||||
backoff := time.Duration(1<<uint(attempt-1)) * time.Second
|
||||
|
||||
Reference in new issue
Block a user