mirror of
https://github.com/fosrl/olm.git
synced 2026-02-23 21:36:40 +00:00
Dont start the ping until we are connected
Former-commit-id: 43c8a14fda
This commit is contained in:
@@ -198,6 +198,9 @@ func (o *Olm) handleConnect(msg websocket.WSMessage) {
|
||||
|
||||
o.connected = true
|
||||
|
||||
// Start ping monitor now that we are registered and connected
|
||||
o.websocket.StartPingMonitor()
|
||||
|
||||
// Invoke onConnected callback if configured
|
||||
if o.olmConfig.OnConnected != nil {
|
||||
go o.olmConfig.OnConnected()
|
||||
|
||||
@@ -362,6 +362,8 @@ func (o *Olm) StartTunnel(config TunnelConfig) {
|
||||
|
||||
if o.connected {
|
||||
logger.Debug("Already connected, skipping registration")
|
||||
// Restart ping monitor on reconnect since the old one would have exited
|
||||
o.websocket.StartPingMonitor()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user