Skip to content

Commit

Permalink
Close file after uploading it to private chat
Browse files Browse the repository at this point in the history
fix #2119
上传文件到私聊后,释放文件。
  • Loading branch information
Janet-Baker committed May 31, 2023
1 parent 2af55d6 commit e22b511
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ func (bot *CQBot) CQUploadPrivateFile(userID int64, file, name string) global.MS
log.Warnf("上传私聊 %v 文件 %v 失败: %+v", userID, file, err)
return Failed(100, "FILE_SYSTEM_UPLOAD_API_ERROR", err.Error())
}
defer func() { _ = fileBody.Close() }()
return OK(nil)
}

Expand Down

0 comments on commit e22b511

Please sign in to comment.