1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-02 20:02:53 +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,7 +293,8 @@ func (g *Gateway) handleWS(stop <-chan struct{}) {
select {
case <-stop:
return
case <-g.paceDeath:
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.
@ -302,6 +303,7 @@ func (g *Gateway) handleWS(stop <-chan struct{}) {
// Then, we'll take the safe way and exit.
return
}
}
case ev := <-ch:
// Check for error

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
}
}
}