Skip to content

Commit

Permalink
Fix keepalive being ignored on startcmd error on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
radovskyb committed Jan 27, 2019
1 parent e4bc9ab commit f33c874
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/watcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ func main() {
c.Stdin = os.Stdin
c.Stdout = os.Stdout
c.Stderr = os.Stderr
err := c.Run()
if err != nil && *keepalive {
log.Println(err)
} else if err != nil {
if err := c.Run(); err != nil {
if (c.ProcessState == nil || !c.ProcessState.Success()) && *keepalive {
log.Println(err)
return
}
log.Fatalln(err)
}
}
Expand Down

0 comments on commit f33c874

Please sign in to comment.