Do spam unready session error on voice reconnec
This commit is contained in:
parent
79d49f86fb
commit
e76dafab78
1 changed files with 8 additions and 10 deletions
18
voice.go
18
voice.go
|
@ -812,10 +812,6 @@ func (v *VoiceConnection) reconnect() {
|
||||||
// Close websocket and udp connections
|
// Close websocket and udp connections
|
||||||
v.Close()
|
v.Close()
|
||||||
|
|
||||||
// Take a short nap to allow everything to close.
|
|
||||||
// may not be needed but just extra protection for now.
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
|
|
||||||
wait := time.Duration(1)
|
wait := time.Duration(1)
|
||||||
|
|
||||||
i := 0
|
i := 0
|
||||||
|
@ -828,6 +824,14 @@ func (v *VoiceConnection) reconnect() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<-time.After(wait * time.Second)
|
||||||
|
wait *= 2
|
||||||
|
if wait > 600 {
|
||||||
|
wait = 600
|
||||||
|
}
|
||||||
|
|
||||||
|
i++
|
||||||
|
|
||||||
if v.session.DataReady == false {
|
if v.session.DataReady == false {
|
||||||
v.log(LogInformational, "cannot reconenct with unready session")
|
v.log(LogInformational, "cannot reconenct with unready session")
|
||||||
continue
|
continue
|
||||||
|
@ -858,11 +862,5 @@ func (v *VoiceConnection) reconnect() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
<-time.After(wait * time.Second)
|
|
||||||
wait *= 2
|
|
||||||
if wait > 600 {
|
|
||||||
wait = 600
|
|
||||||
}
|
|
||||||
i++
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue