Skip to content

Commit

Permalink
numalign: crash on error
Browse files Browse the repository at this point in the history
let's bail out with error if the resources are not aligned

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Jun 1, 2023
1 parent f6b6f63 commit 3f5af11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/numalign/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func main() {
var sleepHoursParam = flag.StringP("sleep-hours", "S", "", "sleep hours once done.")
var scriptPathParam = flag.StringP("script-path", "P", "", "save test script to this path.")
var jsonOutput = flag.BoolP("json", "J", false, "output in JSON")
var sleepOnError = flag.BoolP("sleep-on-error", "E", false, "still sleep if failed before to exit")
flag.Parse()

if _, ok := os.LookupEnv("NUMALIGN_DEBUG"); !ok {
Expand Down Expand Up @@ -89,6 +90,8 @@ func main() {
}
}

time.Sleep(sleepTime)
if rc == 0 || *sleepOnError {
time.Sleep(sleepTime)
}
os.Exit(rc)
}

0 comments on commit 3f5af11

Please sign in to comment.