1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-30 18:53:30 +00:00

Minor fixes that doesn't really fix anything

This commit is contained in:
diamondburned (Forefront) 2020-01-20 01:32:28 -08:00
parent 1746065f70
commit aa4154e73c
2 changed files with 10 additions and 10 deletions

View file

@ -293,14 +293,16 @@ func (g *Gateway) handleWS(stop <-chan struct{}) {
select {
case <-stop:
return
case <-g.paceDeath:
// Pacemaker died, pretty fatal. We'll reconnect though.
if err := g.Reconnect(); err != nil {
// Very fatal if this fails. We'll warn the user.
g.FatalLog(errors.Wrap(err, "Failed to reconnect"))
case err := <-g.paceDeath:
if err != nil {
// Pacemaker died, pretty fatal. We'll reconnect though.
if err := g.Reconnect(); err != nil {
// Very fatal if this fails. We'll warn the user.
g.FatalLog(errors.Wrap(err, "Failed to reconnect"))
// Then, we'll take the safe way and exit.
return
// Then, we'll take the safe way and exit.
return
}
}
case ev := <-ch:

View file

@ -86,9 +86,7 @@ func (p *Pacemaker) start(stop chan struct{}) error {
p.SentBeat = time.Now()
if p.Dead() {
if err := p.OnDead(); err != nil {
return err
}
return ErrDead
}
}
}