Add context where appropriate#2
Conversation
|
cc. @stapelberg |
|
Once we update the users of this pkg we will need to update the func calls to pass in the context. |
|
This will require code changes from users (as you identified), e.g. https://github.com/ssttevee/jitaku-dns/blob/trunk/internal/update/update.go (cc @ssttevee as a heads-up) Given that users need to adjust their code, I think we should introduce a context argument to all methods that send HTTP requests, not just the ones you happen to need right now :) Can you update the PR accordingly please? I’ll take care of the io.ReadAll change separately so that you can keep your PR clean. |
to be able to cancel it from the caller side. Ref: gokrazy/selfupdate#4 (comment)
12bc3f7 to
aabeb55
Compare
|
@stapelberg good suggestions thanks! Done :) |
|
Thanks! |
|
I also took care of the gokrazy/tools update: gokrazy/tools@ab76ef5 |
|
Also gokrazy/bakery and gokrazy/selfupdate: gokrazy/bakery@a12069c and gokrazy/selfupdate@6a7c12e And also sent PRs for downstream users: |
|
Thanks, and thank you for updating the users of this! |
This is to allow cancelling the calls from the caller side.
e.g. in the Reboot() case, where once the caller process (normally a gokrazy managed process) receives the SIGTERM signal which Reboot() itself happens to trigger via its calling of the
killSupervisedServicesAndUmountPerm()function, to avoid a blocking behaviour until SIGKILL kicks in.Context for this change here: gokrazy/selfupdate#4 (comment)