Merge pull request #3184 from chengzhichao-xydt/codex/ws-body-close
fix(channels): explicitly ignore resp.Body.Close() errors in websocket dial cleanup
This commit is contained in:
commit
979f440af7
2 changed files with 2 additions and 2 deletions
|
|
@ -88,7 +88,7 @@ func (c *PicoClientChannel) dial() error {
|
||||||
|
|
||||||
ws, resp, err := websocket.DefaultDialer.DialContext(c.ctx, c.config.URL, header)
|
ws, resp, err := websocket.DefaultDialer.DialContext(c.ctx, c.config.URL, header)
|
||||||
if resp != nil && resp.Body != nil {
|
if resp != nil && resp.Body != nil {
|
||||||
resp.Body.Close()
|
_ = resp.Body.Close()
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ func (c *WhatsAppChannel) Start(ctx context.Context) error {
|
||||||
|
|
||||||
conn, resp, err := dialer.Dial(c.url, nil)
|
conn, resp, err := dialer.Dial(c.url, nil)
|
||||||
if resp != nil {
|
if resp != nil {
|
||||||
resp.Body.Close()
|
_ = resp.Body.Close()
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.cancel()
|
c.cancel()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue