mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix file not close when ReadAll returns error in local chunk manager (#15068)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
f4b5a6733e
commit
998ebcce4e
@ -82,11 +82,12 @@ func (lcm *LocalChunkManager) Read(key string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
content, err := ioutil.ReadAll(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return content, file.Close()
|
||||
return content, nil
|
||||
}
|
||||
|
||||
// ReadAt reads specific position data of local storage if exists.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user