Conversation
pkg/build/build.go
Outdated
| err = <-managerExit | ||
| close(managerExit) | ||
| return err | ||
| interrupted := make(chan os.Signal, 1) |
There was a problem hiding this comment.
Is there a way we could move this "out" since its really a global cancellation, not simply cancelling this subroutine. I'm used to this getting set up along with other intialization, usually in the main() method. We should be able to cancel a context there which cascades down in to cancelling this context.
There was a problem hiding this comment.
Ah good idea. Will move it up.
cmoulliard
left a comment
There was a problem hiding this comment.
Should we also add SIGINT to tell to the program to print interrupt and then exit ?
My understanding is |
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
This PR makes idpbuilder handle interrupts correctly. Currently, idpbuilder doesn't handle signals well. For example, if you send ctrl+c while it's executing, it prints out a message saying
Finished Creating IDP Successfully!. With this PR, it correctly says that the command execution was interrupted. It still prints command usages at the end but we can address that in another PR.