utils: Take monitorShutdownSignal to take an exitFunc which would executed upon error. (#2378)

This hook approach allows program to keep running but being able to handle exiting
of the program in the dynamic way.

Fixes #2377
This commit is contained in:
Harshavardhana
2016-08-06 23:53:10 -07:00
committed by GitHub
parent b23605a2b5
commit 0188cd0b84
3 changed files with 18 additions and 17 deletions

View File

@@ -191,7 +191,7 @@ func main() {
// Initialize and monitor shutdown signal
shutdownSignal = make(chan bool, 1)
monitorShutdownSignal()
monitorShutdownSignal(os.Exit)
// Run the app - exit on error.
app.RunAndExitOnError()