mirror of
https://github.com/nonoo/kappanhang.git
synced 2026-01-01 22:40:00 +01:00
Wait a little if control stream init fails to avoid overload
This commit is contained in:
parent
db10d47f8f
commit
c03fea5757
8
main.go
8
main.go
|
|
@ -38,7 +38,13 @@ func runControlStream(osSignal chan os.Signal) (shouldExit bool, exitCode int) {
|
|||
if err := ctrl.init(); err != nil {
|
||||
log.Error(err)
|
||||
ctrl.deinit()
|
||||
return false, 0
|
||||
t := time.NewTimer(time.Second)
|
||||
select {
|
||||
case <-t.C:
|
||||
return false, 0
|
||||
case <-osSignal:
|
||||
return true, 0
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
|
|
|
|||
Loading…
Reference in a new issue