diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-02-02 22:15:25 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-02-03 11:19:48 +0000 |
| commit | c7aa7a4320104000588c4cb7577ab88d4bfa2006 (patch) | |
| tree | 759f0402cb0a29bbda0794f015ce41bd73c6e807 | |
| parent | 2b416f00a72c2c04894f119db7899eba89f06bfe (diff) | |
| download | mullvadvpn-c7aa7a4320104000588c4cb7577ab88d4bfa2006.tar.xz mullvadvpn-c7aa7a4320104000588c4cb7577ab88d4bfa2006.zip | |
Improve rotation interval constant declaration
Remove repeated documentation and variable name.
| -rw-r--r-- | mullvad-daemon/src/wireguard.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mullvad-daemon/src/wireguard.rs b/mullvad-daemon/src/wireguard.rs index 9d6d25947f..0939a0afac 100644 --- a/mullvad-daemon/src/wireguard.rs +++ b/mullvad-daemon/src/wireguard.rs @@ -21,12 +21,11 @@ pub use talpid_types::net::wireguard::{ use talpid_types::ErrorExt; /// Default automatic key rotation -#[cfg(not(target_os = "android"))] -const DEFAULT_AUTOMATIC_KEY_ROTATION: Duration = Duration::from_secs(7 * 24 * 60 * 60); -/// Default automatic key rotation -#[cfg(target_os = "android")] -const DEFAULT_AUTOMATIC_KEY_ROTATION: Duration = Duration::from_secs(4 * 24 * 60 * 60); - +const DEFAULT_AUTOMATIC_KEY_ROTATION: Duration = if cfg!(target_os = "android") { + Duration::from_secs(4 * 24 * 60 * 60) +} else { + Duration::from_secs(7 * 24 * 60 * 60) +}; /// How long to wait before reattempting to rotate keys on failure const AUTOMATIC_ROTATION_RETRY_DELAY: Duration = Duration::from_secs(60 * 15); /// How long to wait before starting the first key rotation. |
