Wait a little if control stream init fails to avoid overload

This commit is contained in:
Nonoo 2020-10-29 22:11:33 +01:00
parent db10d47f8f
commit c03fea5757

View file

@ -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 {