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:
parent
1746065f70
commit
aa4154e73c
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue