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.

return error early

Chris Lue6ef7b238793
diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go
index 9eac696318..b4d44eccfb 100644
--- a/weed/operation/assign_file_id.go
+++ b/weed/operation/assign_file_id.go
@@ -66,6 +66,10 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
return grpcErr
}
+ if resp.Error != "" {
+ return fmt.Errorf("assignRequest: %v", resp.Error)
+ }
+
ret.Count = resp.Count
ret.Fid = resp.Fid
ret.Url = resp.Location.Url
@@ -80,10 +84,6 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
})
}
- if resp.Error != "" {
- return fmt.Errorf("assignRequest: %v", resp.Error)
- }
-
return nil
})