From 6086f45d2597be1a0baa0fae95b82d8ba776e874 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sun, 4 Dec 2022 18:28:10 +0800 Subject: [PATCH] fix: in disk cache readCacheFileStream should closed upon return (#16138) --- cmd/format-disk-cache.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/format-disk-cache.go b/cmd/format-disk-cache.go index a8930cc98..325aceeec 100644 --- a/cmd/format-disk-cache.go +++ b/cmd/format-disk-cache.go @@ -354,6 +354,7 @@ func migrateCacheData(ctx context.Context, c *diskCache, bucket, object, oldfile if err != nil { return err } + defer readCloser.Close() var reader io.Reader = readCloser actualSize := uint64(st.Size())