Feedback as per @mlctrez

This commit is contained in:
James Mills 2022-04-05 12:50:24 +10:00
parent 2d731e0393
commit b79f4c8f6d
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -29,7 +29,7 @@ const (
DefaultMaxReconnectInterval = 64
// DefaultPingInterval is the default time interval (in seconds) between pings
DefaultPingInterval = 5
DefaultPingInterval = 60
)
var (
@ -290,6 +290,8 @@ func (s *Subscriber) writeloop(ctx context.Context, conn *websocket.Conn) {
t := time.NewTicker(s.pingInterval)
s.RUnlock()
defer t.Stop()
for {
select {
case <-ctx.Done():