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

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())