Revert "Don't attempt to reconenct if we're actually closign down"
This reverts commit e954f2f47f
.
This commit is contained in:
rodič
be7c8bb616
revize
e6ab9d9c70
|
@ -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)
|
||||
}
|
||||
|
|
Načítá se…
Odkázat v novém úkolu