mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
client: add missing retry cancel check while backing off requests
This commit is contained in:
parent
02ce6ff918
commit
f6d8362278
1 changed files with 3 additions and 1 deletions
|
|
@ -614,7 +614,9 @@ func (cli *Client) doRetry(
|
|||
select {
|
||||
case <-time.After(backoff):
|
||||
case <-req.Context().Done():
|
||||
return nil, nil, req.Context().Err()
|
||||
if !errors.Is(context.Cause(req.Context()), ErrContextCancelRetry) {
|
||||
return nil, nil, req.Context().Err()
|
||||
}
|
||||
}
|
||||
if cli.UpdateRequestOnRetry != nil {
|
||||
req = cli.UpdateRequestOnRetry(req, cause)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue