mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-06-19 05:55:04 +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
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rd.Close()
|
defer rd.Close()
|
||||||
|
defer r.client().CloseIdleConnections()
|
||||||
return io.ReadAll(rd)
|
return io.ReadAll(rd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +148,7 @@ func (r Request) JSON() (gjson.Result, error) {
|
|||||||
return gjson.Result{}, err
|
return gjson.Result{}, err
|
||||||
}
|
}
|
||||||
defer rd.Close()
|
defer rd.Close()
|
||||||
|
defer r.client().CloseIdleConnections()
|
||||||
|
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
_, err = io.Copy(&sb, rd)
|
_, err = io.Copy(&sb, rd)
|
||||||
@ -174,6 +176,7 @@ func (r Request) WriteToFile(path string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rd.Close()
|
defer rd.Close()
|
||||||
|
defer r.client().CloseIdleConnections()
|
||||||
return writeToFile(rd, path)
|
return writeToFile(rd, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,6 +186,7 @@ func (r Request) WriteToFileMultiThreading(path string, thread int) error {
|
|||||||
return r.WriteToFile(path)
|
return r.WriteToFile(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer r.client().CloseIdleConnections()
|
||||||
limit := r.Limit
|
limit := r.Limit
|
||||||
type BlockMetaData struct {
|
type BlockMetaData struct {
|
||||||
BeginOffset int64
|
BeginOffset int64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user