Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Track connection/login only on websocket event
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Feb 22, 2024
1 parent 1c6c9c6 commit 442228f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,6 @@ func (user *User) startupTryConnect(retryCount int) {
user.log.Error().Msg("statusChan is nil after Connect")
return
}
user.bridge.Metrics.TrackConnectionState(user.SignalID, true)
user.bridge.Metrics.TrackLoginState(user.SignalID, true)
// After Connect returns, all bridge states are triggered by events on the statusChan
go func() {
var peekedConnectionStatus signalmeow.SignalConnectionStatus
Expand All @@ -426,6 +424,7 @@ func (user *User) startupTryConnect(retryCount int) {
user.log.Debug().Msg("Sending Connected BridgeState")
user.BridgeState.Send(status.BridgeState{StateEvent: status.StateConnected})
user.bridge.Metrics.TrackConnectionState(user.SignalID, true)
user.bridge.Metrics.TrackLoginState(user.SignalID, true)

case signalmeow.SignalConnectionEventDisconnected:
user.log.Debug().Msg("Received SignalConnectionEventDisconnected")
Expand Down

0 comments on commit 442228f

Please sign in to comment.