mirror of
https://github.com/nonoo/kappanhang.git
synced 2026-02-05 07:14:53 +01:00
Don't wait a lot when got radio disconnected message
This commit is contained in:
parent
cdedfa4cc5
commit
505fc23447
13
main.go
13
main.go
|
|
@ -42,9 +42,13 @@ func runControlStream(osSignal chan os.Signal) (shouldExit bool, exitCode int) {
|
|||
}
|
||||
|
||||
select {
|
||||
case <-gotErrChan:
|
||||
case requireWait := <-gotErrChan:
|
||||
ctrl.deinit()
|
||||
|
||||
if !requireWait {
|
||||
return
|
||||
}
|
||||
|
||||
// Need to wait before reinit because the IC-705 will disconnect our audio stream eventually if we relogin
|
||||
// in a too short interval without a deauth...
|
||||
t := time.NewTicker(time.Second)
|
||||
|
|
@ -69,9 +73,14 @@ func reportError(err error) {
|
|||
log.ErrorC(log.GetCallerFileName(true), ": ", err)
|
||||
}
|
||||
|
||||
requireWait := true
|
||||
if strings.Contains(err.Error(), "got radio disconnected") {
|
||||
requireWait = false
|
||||
}
|
||||
|
||||
// Non-blocking notify.
|
||||
select {
|
||||
case gotErrChan <- false:
|
||||
case gotErrChan <- requireWait:
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue