Skip to content

Commit

Permalink
set err code to timeout if ctx is done
Browse files Browse the repository at this point in the history
  • Loading branch information
amirylm committed Feb 22, 2024
1 parent 1cd2a97 commit 528efd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func (c *client) singleFeedRequest(ctx context.Context, ch chan<- mercury.Mercur
retryable = true
state = encoding.MercuryFlakyFailure
errCode = encoding.ErrCodeStreamsUnknownError
if ctx.Err() != nil {
errCode = encoding.ErrCodeStreamsTimeout
}
return err
}
defer httpResponse.Body.Close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ func (c *client) multiFeedsRequest(ctx context.Context, ch chan<- mercury.Mercur
retryable = true
state = encoding.MercuryFlakyFailure
errCode = encoding.ErrCodeStreamsUnknownError
if ctx.Err() != nil {
errCode = encoding.ErrCodeStreamsTimeout
}
return err
}
defer resp.Body.Close()
Expand Down

0 comments on commit 528efd0

Please sign in to comment.