-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: WithContext had no effect #1337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for outlining the problem. Haven't noticed it myself when implementing the options.
However I'm not sure this solution would be correct one, as it's not entirely consistent with how other options are implemented.
Looking through the code of RequestWithLockedBucket
, it uses cfg.Client.Do(req)
for making a request. If that line would be replaced by cfg.Client.Do(cfg.Request)
this problem would be solved.
@FedorLap2006 I still prefer my first version, but I changed it to reassign |
My mistake, yes, there were a few other places that it was used in. |
@FedorLap2006 Hi, I followed your suggestion and updated the code. My two cents are the first version with More consistent: All the other Cleaner: It's better to have only one request in-scope in the You have final say, of course. 😅 |
Sorry for taking matter into my own hands. After thinking for a while, the second solution (with reassigning P.S. Another way this could have been implemented was to use a |
Sorry for commiting right on the branch. Since the release is planned for today, I've decided to not prolong the things even more and apply all the edits myself. Thank you for the contribution! |
Fix usage of an outdated request in RequestWithLockedBucket after applying WithContext option --------- Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
@FedorLap2006 No worries! Ultimately what matters most is the bug is fixed. 😄 Thanks for the review. |
Fixes #1336