diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-07-08 15:31:17 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-07-13 15:57:36 +0200 |
| commit | 1e003cb185561ea5ddba9388b3afe4b337f89e8c (patch) | |
| tree | cb23350cec630645a99c358a34692fa022445d7a | |
| parent | 5234e9dbc775f27799881bed9a2c480f6498b0f3 (diff) | |
| download | mullvadvpn-1e003cb185561ea5ddba9388b3afe4b337f89e8c.tar.xz mullvadvpn-1e003cb185561ea5ddba9388b3afe4b337f89e8c.zip | |
Replace delay_for with sleep
| -rw-r--r-- | mullvad-daemon/src/lib.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/version_check.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/wireguard.rs | 2 | ||||
| -rw-r--r-- | mullvad-problem-report/src/lib.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/future_retry.rs | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index a4c3a6f96c..c2f2cfd42c 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -1120,7 +1120,7 @@ where async fn schedule_reconnect(&mut self, delay: Duration) { let tunnel_command_tx = self.tx.to_specialized_sender(); let (future, abort_handle) = abortable(Box::pin(async move { - tokio::time::delay_for(delay).await; + tokio::time::sleep(delay).await; log::debug!("Attempting to reconnect"); let (tx, _) = oneshot::channel(); let _ = tunnel_command_tx.send(DaemonCommand::Reconnect(tx)); diff --git a/mullvad-daemon/src/version_check.rs b/mullvad-daemon/src/version_check.rs index 4d7be8ad38..97fcb9aa5e 100644 --- a/mullvad-daemon/src/version_check.rs +++ b/mullvad-daemon/src/version_check.rs @@ -269,7 +269,7 @@ impl VersionUpdater { pub async fn run(mut self) { let mut rx = self.rx.take().unwrap().fuse(); - let next_delay = || tokio::time::delay_for(UPDATE_CHECK_INTERVAL).fuse(); + let next_delay = || tokio::time::sleep(UPDATE_CHECK_INTERVAL).fuse(); let mut check_delay = next_delay(); let mut version_check = futures::future::Fuse::terminated(); diff --git a/mullvad-daemon/src/wireguard.rs b/mullvad-daemon/src/wireguard.rs index 575ffa261c..1c548d3e8d 100644 --- a/mullvad-daemon/src/wireguard.rs +++ b/mullvad-daemon/src/wireguard.rs @@ -304,7 +304,7 @@ impl KeyManager { rotation_interval_secs: u64, account_token: AccountToken, ) { - tokio::time::delay_for(ROTATION_START_DELAY).await; + tokio::time::sleep(ROTATION_START_DELAY).await; let rotate_key_for_account = move |old_key: &PublicKey| { Self::rotate_key( diff --git a/mullvad-problem-report/src/lib.rs b/mullvad-problem-report/src/lib.rs index 39bd66762f..a3f8659ac8 100644 --- a/mullvad-problem-report/src/lib.rs +++ b/mullvad-problem-report/src/lib.rs @@ -310,7 +310,7 @@ pub fn send_problem_report( ) } } - tokio::time::delay_for(RETRY_INTERVAL).await; + tokio::time::sleep(RETRY_INTERVAL).await; } Err(Error::SendProblemReportError) }) diff --git a/talpid-core/src/future_retry.rs b/talpid-core/src/future_retry.rs index 2a7a08a092..6e7c05fc35 100644 --- a/talpid-core/src/future_retry.rs +++ b/talpid-core/src/future_retry.rs @@ -32,10 +32,10 @@ pub async fn retry_future_with_backoff< async fn sleep(mut delay: Duration) { while delay > MAX_SINGLE_DELAY { delay -= MAX_SINGLE_DELAY; - tokio::time::delay_for(MAX_SINGLE_DELAY).await; + tokio::time::sleep(MAX_SINGLE_DELAY).await; } - tokio::time::delay_for(delay).await; + tokio::time::sleep(delay).await; } /// Provides an exponential back-off timer to delay the next retry of a failed operation. |
