fix: adding reconnect when deadline met
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
const (
|
||||
pingPeriod = 10 * time.Second
|
||||
readDeadline = 10 * time.Second
|
||||
readDeadline = 30 * time.Second
|
||||
)
|
||||
|
||||
type SafeMap[K comparable, V any] struct {
|
||||
@@ -300,6 +300,7 @@ func (wsClient *SafeWebsocketClient) connect() error {
|
||||
return
|
||||
}
|
||||
if err := conn.SetReadDeadline(time.Now().Add(readDeadline)); err != nil {
|
||||
wsClient.triggerReconnect()
|
||||
fmt.Printf("error on read deadline: %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user