From ce53d7f6c22ac527d4306433f6d4a0e471590c8d Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sat, 26 Nov 2022 16:26:15 +0800 Subject: [PATCH] add disk.Close() in healFreshDisk to indicate idiomatic flow of code (#16124) --- cmd/background-newdisks-heal-ops.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/background-newdisks-heal-ops.go b/cmd/background-newdisks-heal-ops.go index 50d85eb1c..cef2af553 100644 --- a/cmd/background-newdisks-heal-ops.go +++ b/cmd/background-newdisks-heal-ops.go @@ -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())