diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-08-25 17:01:26 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-08-25 17:04:45 +0200 |
| commit | d95a59b7dabd472c4d6fc75acaad873ac8045fb2 (patch) | |
| tree | 46b82e7f824da5323d0b604d11db96750d14a698 | |
| parent | 6543d9dca1fa48cb7df3e68e627eb0de2d748175 (diff) | |
| download | mullvadvpn-d95a59b7dabd472c4d6fc75acaad873ac8045fb2.tar.xz mullvadvpn-d95a59b7dabd472c4d6fc75acaad873ac8045fb2.zip | |
Fix relay update interval being constantly resolved in loop
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs index 82a30d3f7c..9971d04c8f 100644 --- a/mullvad-daemon/src/relays.rs +++ b/mullvad-daemon/src/relays.rs @@ -807,11 +807,9 @@ impl RelayListUpdater { } async fn run(mut self, mut cmd_rx: mpsc::Receiver<()>) { + let mut check_interval = tokio02::time::interval(UPDATE_CHECK_INTERVAL).fuse(); + let mut download_future = Box::pin(Fuse::terminated()); loop { - let mut check_interval = tokio02::time::interval(UPDATE_CHECK_INTERVAL).fuse(); - let mut download_future = Box::pin(Fuse::terminated()); - - futures::select! { _check_update = check_interval.next() => { if !download_future.is_terminated() && self.should_update() { |
