Fix race in shutdown: context should be shut down in case of error.

This commit is contained in:
Andrey Smirnov
2014-03-04 18:39:43 +04:00
parent 1902f38e6b
commit 410caa6141
2 changed files with 13 additions and 3 deletions
+4
View File
@@ -39,6 +39,7 @@ func loadConfig(command *commander.Command) error {
}
if !os.IsNotExist(err) {
fatal(fmt.Errorf("error loading config file %s: %s", configLocation, err))
return nil
}
}
@@ -67,6 +68,9 @@ func main() {
fatal(err)
return
}
if returnCode != 0 {
return
}
err = cmd.InitContext(command)
if err != nil {