*: Add cancellation handling via contexts
Add ctx parameter to cmd_pull, cmd_restore and inner functions that they call that can block and handle ctx cancel where we can. For now both pull and restore are always run under background context, but in the next patch we'll connect SIGINT+SIGTERM to cancel spawned work. In general a service - even a command line utility - needs to handle cancellation properly and itself to maintain consistency of external state. See e.g. https://callistaenterprise.se/blogg/teknik/2019/10/05/go-worker-cancellation/ for example.
Showing
This diff is collapsed.
Please register or sign in to comment