diff --git a/TunnelKit/Sources/Core/CoreConfiguration.swift b/TunnelKit/Sources/Core/CoreConfiguration.swift index 3cb9371..a399c69 100644 --- a/TunnelKit/Sources/Core/CoreConfiguration.swift +++ b/TunnelKit/Sources/Core/CoreConfiguration.swift @@ -60,6 +60,8 @@ class CoreConfiguration { static var versionIdentifier: String? static let logsSensitiveData = false + + static var reconnectionDelay = 2.0 } extension CustomStringConvertible { diff --git a/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNProvider.swift b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNProvider.swift index 8421530..0809d16 100644 --- a/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNProvider.swift +++ b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNProvider.swift @@ -152,7 +152,7 @@ public class OpenVPNProvider: VPNProvider { } if self.status != .disconnected { self.manager?.connection.stopVPNTunnel() - DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: connectBlock) + DispatchQueue.main.asyncAfter(deadline: .now() + CoreConfiguration.reconnectionDelay, execute: connectBlock) } else { connectBlock() }