Skip to content

Commit

Permalink
wait an hour for windows user
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Mar 5, 2024
1 parent b012f9e commit 37c1405
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,20 @@ func main() {

exitCode := -1
defer func() {
if exitCode >= 0 {
os.Exit(exitCode)
code := exitCode
if code < 0 {
select {
case code = <-exitCh:
default:
code = 0
}
}
select {
case code := <-exitCh:
os.Exit(code)
default:
os.Exit(0)
if code != 0 {
log.Errorf("Program exiting with code %d", exitCode)
log.Error("Please read https://github.com/LiterMC/go-openbmclapi?tab=readme-ov-file#faq before report your issue")
if runtime.GOOS == "windows" {
time.Sleep(time.Hour)
}
}
}()
defer log.RecordPanic()
Expand Down

0 comments on commit 37c1405

Please sign in to comment.