TunnelsManager: func tunnelInOperation()

This commit is contained in:
Roopesh Chander 2019-01-24 18:11:26 +05:30
parent 1e3be2a51e
commit a099d6fa26
1 changed files with 7 additions and 0 deletions

View File

@ -234,6 +234,13 @@ class TunnelsManager {
return tunnels.first { $0.status == .waiting }
}
func tunnelInOperation() -> TunnelContainer? {
if let waitingTunnelObject = waitingTunnel() {
return waitingTunnelObject
}
return tunnels.first { $0.status != .inactive }
}
func startActivation(of tunnel: TunnelContainer) {
guard tunnels.contains(tunnel) else { return } // Ensure it's not deleted
guard tunnel.status == .inactive else {