Centralize reconnection delay
This commit is contained in:
parent
341e0e3ba8
commit
663cab34c9
|
@ -60,6 +60,8 @@ class CoreConfiguration {
|
||||||
static var versionIdentifier: String?
|
static var versionIdentifier: String?
|
||||||
|
|
||||||
static let logsSensitiveData = false
|
static let logsSensitiveData = false
|
||||||
|
|
||||||
|
static var reconnectionDelay = 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
extension CustomStringConvertible {
|
extension CustomStringConvertible {
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class OpenVPNProvider: VPNProvider {
|
||||||
}
|
}
|
||||||
if self.status != .disconnected {
|
if self.status != .disconnected {
|
||||||
self.manager?.connection.stopVPNTunnel()
|
self.manager?.connection.stopVPNTunnel()
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: connectBlock)
|
DispatchQueue.main.asyncAfter(deadline: .now() + CoreConfiguration.reconnectionDelay, execute: connectBlock)
|
||||||
} else {
|
} else {
|
||||||
connectBlock()
|
connectBlock()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue