Skip to content

Commit

Permalink
Merge pull request #5814 from mysteriumnetwork/fix-monitoring-endpoint
Browse files Browse the repository at this point in the history
Check all service types for monitoring status endpoint
  • Loading branch information
soffokl authored May 30, 2023
2 parents 19f180f + c7a1421 commit a470c85
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions core/node/node_status_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
package node

import (
"github.com/mysteriumnetwork/node/core"

"github.com/mysteriumnetwork/node/identity"
)

Expand Down Expand Up @@ -79,23 +77,11 @@ func (k *MonitoringStatusTracker) Status() MonitoringStatus {
}

func resolveMonitoringStatus(sessions []Session) MonitoringStatus {
wgSession, ok := findWireGuard(sessions)
if !ok {
return Pending
}

if wgSession.MonitoringFailed {
return Failed
}
return Passed
}

// openvpn is considered deprecated
func findWireGuard(sessions []Session) (Session, bool) {
for _, s := range sessions {
if s.ServiceType == core.WireGuard.String() {
return s, true
if s.MonitoringFailed {
return Failed
}
}
return Session{}, false

return Passed
}

0 comments on commit a470c85

Please sign in to comment.