Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

weed/mount: simplify metadata flush retry returns (#8763)

Chris Lu6c35a3724aa4
diff --git a/weed/mount/metadata_flush_retry.go b/weed/mount/metadata_flush_retry.go
index c5acd03412..f4fe2bcc32 100644
--- a/weed/mount/metadata_flush_retry.go
+++ b/weed/mount/metadata_flush_retry.go
@@ -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