Revert "Don't attempt to reconenct if we're actually closign down"

This reverts commit e954f2f47f.
This commit is contained in:
James Mills 2022-03-29 11:30:40 +10:00
rodič be7c8bb616
revize e6ab9d9c70
V databázi nebyl nalezen žádný známý klíč pro tento podpis
ID GPG klíče: AC4C014F1440EBD6

Zobrazit soubor

@ -232,9 +232,7 @@ func (s *Subscriber) readLoop(ctx context.Context) {
for {
err := wsjson.Read(ctx, s.conn, &msg)
if err != nil {
if websocket.CloseStatus(err) != websocket.StatusNormalClosure {
s.closeAndReconnect()
}
s.closeAndReconnect()
return
}
@ -275,10 +273,7 @@ func (s *Subscriber) heartbeat(ctx context.Context, d time.Duration) {
// c.Ping returns on receiving a pong
err := s.conn.Ping(ctx)
if err != nil {
if websocket.CloseStatus(err) != websocket.StatusNormalClosure {
s.closeAndReconnect()
}
return
s.closeAndReconnect()
}
t.Reset(time.Minute)
}