add disk.Close() in healFreshDisk to indicate idiomatic flow of code (#16124)

This commit is contained in:
jiuker 2022-11-26 16:26:15 +08:00 committed by GitHub
parent fe8eed963e
commit ce53d7f6c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,7 @@ func healFreshDisk(ctx context.Context, z *erasureServerPools, endpoint Endpoint
if err != nil {
return fmt.Errorf("Error: %w, %s", err, endpoint)
}
defer disk.Close()
poolIdx := globalEndpoints.GetLocalPoolIdx(disk.Endpoint())
if poolIdx < 0 {
return fmt.Errorf("unexpected pool index (%d) found in %s", poolIdx, disk.Endpoint())