You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to run a target/function when another target gets closed using ctrl-c. The reason for this is I'm creating a webserver using go, and have a mage target to build an executable and run it, and the only way to close it is by using ctrl-c. I would like to be able to run the target Cleanup() after hitting ctrl-c.
Is there anyway to do this? Is this what context.Context() is for?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hmm yeah, that's a feature I intended to implement with the context, but currently it's not implemented. What should happen is that ctrl-c should cancel the context and then exit after a short wait.
I would like to run a target/function when another target gets closed using ctrl-c. The reason for this is I'm creating a webserver using go, and have a mage target to build an executable and run it, and the only way to close it is by using ctrl-c. I would like to be able to run the target Cleanup() after hitting ctrl-c.
Is there anyway to do this? Is this what context.Context() is for?
Thanks in advance!
The text was updated successfully, but these errors were encountered: