Skip to content

Commit

Permalink
Merge pull request #1222 from ersonp/fix/vpn-reconnecting-status
Browse files Browse the repository at this point in the history
Fix vpn reconnecting status
  • Loading branch information
mrpalide authored May 25, 2022
2 parents 76f20b0 + 2c2009b commit cd14ca2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions pkg/app/launcher/app_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const (

// AppStatusStarting represents status of an app starting.
AppStatusStarting

// AppStatusReconnecting represents status of VPN client re-connecting.
AppStatusReconnecting
)

// AppState defines state parameters for a registered App.
Expand All @@ -34,15 +31,15 @@ const (
// AppDetailedStatusStarting is set during app initilization process.
AppDetailedStatusStarting = "Starting"

// AppDetailedStatusRunning is set when the app is running.
AppDetailedStatusRunning = "Running"

// AppDetailedStatusVPNConnecting is set during VPN-client session establishment (including handshake).
AppDetailedStatusVPNConnecting = "Connecting"

// AppDetailedStatusRunning is set when all establishment is done and / or app is running.
AppDetailedStatusRunning = "Running"
// AppDetailedStatusVPNReconnecting is set after connection failure in VPN-client, during reconnection.
AppDetailedStatusVPNReconnecting = "Connection failed, reconnecting"

// AppDetailedStatusShuttingDown is set during shutdown.
AppDetailedStatusShuttingDown = "Shutting down"

// AppDetailedStatusVPNReconnecting is set after connection failure in VPN-client, during reconnection.
AppDetailedStatusVPNReconnecting = "Connection failed, reconnecting"
)
3 changes: 2 additions & 1 deletion pkg/app/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ func (l *Launcher) AppState(name string) (*AppState, bool) {
state.DetailedStatus = AppDetailedStatusStarting
state.Status = AppStatusStarting
}
if state.DetailedStatus == AppDetailedStatusVPNConnecting || state.DetailedStatus == AppDetailedStatusStarting {
switch state.DetailedStatus {
case AppDetailedStatusVPNConnecting, AppDetailedStatusStarting, AppDetailedStatusVPNReconnecting:
state.Status = AppStatusStarting
}
}
Expand Down

0 comments on commit cd14ca2

Please sign in to comment.