mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-06-18 13:35:03 +08:00
* fix #2368 * add CloseIdleConnections at WriteToFileMultiThreading
This commit is contained in:
parent
977030e814
commit
da9f03fa47
@ -137,6 +137,7 @@ func (r Request) Bytes() ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
defer rd.Close()
|
||||
defer r.client().CloseIdleConnections()
|
||||
return io.ReadAll(rd)
|
||||
}
|
||||
|
||||
@ -147,6 +148,7 @@ func (r Request) JSON() (gjson.Result, error) {
|
||||
return gjson.Result{}, err
|
||||
}
|
||||
defer rd.Close()
|
||||
defer r.client().CloseIdleConnections()
|
||||
|
||||
var sb strings.Builder
|
||||
_, err = io.Copy(&sb, rd)
|
||||
@ -174,6 +176,7 @@ func (r Request) WriteToFile(path string) error {
|
||||
return err
|
||||
}
|
||||
defer rd.Close()
|
||||
defer r.client().CloseIdleConnections()
|
||||
return writeToFile(rd, path)
|
||||
}
|
||||
|
||||
@ -183,6 +186,7 @@ func (r Request) WriteToFileMultiThreading(path string, thread int) error {
|
||||
return r.WriteToFile(path)
|
||||
}
|
||||
|
||||
defer r.client().CloseIdleConnections()
|
||||
limit := r.Limit
|
||||
type BlockMetaData struct {
|
||||
BeginOffset int64
|
||||
|
Loading…
x
Reference in New Issue
Block a user