Update dependencies and go1.18 (#1873)

* Update dependencies and go1.18

* Exclude unnecessary linters and update build to go1.18
This commit is contained in:
Wim
2022-08-13 16:14:26 +02:00
committed by GitHub
parent 3c4192ebf6
commit 6a3fc71397
396 changed files with 350176 additions and 309792 deletions

View File

@@ -201,17 +201,17 @@ func (cli *Client) retryFrame(reqType, id string, data []byte, origResp *waBinar
return nil, err
}
var resp *waBinary.Node
if ctx != nil && timeout > 0 {
select {
case resp = <-respChan:
case <-ctx.Done():
return nil, ctx.Err()
case <-time.After(timeout):
// FIXME this error isn't technically correct (but works for now - the ctx and timeout params are only used from sendIQ)
return nil, ErrIQTimedOut
}
} else {
resp = <-respChan
timeoutChan := make(<-chan time.Time, 1)
if timeout > 0 {
timeoutChan = time.After(timeout)
}
select {
case resp = <-respChan:
case <-ctx.Done():
return nil, ctx.Err()
case <-timeoutChan:
// FIXME this error isn't technically correct (but works for now - the timeout param is only used from sendIQ)
return nil, ErrIQTimedOut
}
if isDisconnectNode(resp) {
cli.Log.Debugf("Retrying %s %s was interrupted by websocket disconnection (%v), not retrying anymore", reqType, id, resp.XMLString())