Fix minio object leaking goroutine (#6944)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/6947/head
congqixia 2021-08-02 15:25:24 +08:00 committed by GitHub
parent fe50f97726
commit 4d5eeb2890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,9 @@ func (kv *MinIOKV) LoadWithPrefix(key string) ([]string, []string, error) {
func (kv *MinIOKV) Load(key string) (string, error) {
object, err := kv.minioClient.GetObject(kv.ctx, kv.bucketName, key, minio.GetObjectOptions{})
if object != nil {
defer object.Close()
}
if err != nil {
return "", err
}