Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from jaxxstorm/infinite_timeouts
Browse files Browse the repository at this point in the history
Allow infinite timeouts again
  • Loading branch information
jaxxstorm authored Jan 6, 2017
2 parents 54633b0 + 625851e commit 34cc61e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sensu-wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ func run_command(cmdName string, cmdArgs []string, timeout int) (int, string) {
}

timer := time.AfterFunc(time.Second*time.Duration(timeout), func() {
err := cmd.Process.Kill()
if err != nil {
panic(err)
if timeout > 0 {
err := cmd.Process.Kill()
if err != nil {
panic(err)
}
}
})

Expand Down Expand Up @@ -106,7 +108,7 @@ func main() {
if c.IsSet("timeout") {
timeout = c.Int("timeout")
} else {
timeout = 5
timeout = 0
}

if !c.Args().Present() {
Expand Down

0 comments on commit 34cc61e

Please sign in to comment.