Skip to content

Commit

Permalink
Add timeout for sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 20, 2023
1 parent ac13182 commit 78d70c9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,19 @@ func main() {
panic(err)
}
log.Println("Running sanity check...")
safetyExitCancel := make(chan struct{})
go func() {
select {
case <-time.After(5 * time.Second):
log.Fatalln("Sanity check timed out")
case <-safetyExitCancel:
}
}()
err = InitSanityCheck()
if err != nil {
panic(err)
}
close(safetyExitCancel)
if *checkCompatibility {
log.Println("Compatibility check successful")
if *jsonOutput {
Expand Down

0 comments on commit 78d70c9

Please sign in to comment.