Sleep before retrying on a transient error (#63)
To avoid excessive CPU consumption.
This commit is contained in:
Родитель
f0e6e5ac14
Коммит
cba28428b2
|
@ -227,6 +227,9 @@ func (l *Link) startResponseRouter() {
|
|||
if isClosedError(err) {
|
||||
l.broadcastError(err)
|
||||
break
|
||||
} else if err != nil {
|
||||
// this is some transient error, sleep before trying again
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
||||
// I don't believe this should happen. The JS version of this same code
|
||||
|
|
Загрузка…
Ссылка в новой задаче