diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-08-25 18:05:45 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-08-25 18:05:45 +0200 |
| commit | 33ce76c1949c5e1152adff6f154bbecb1e8746f3 (patch) | |
| tree | f364acbece13872974b238dfa1d7d396cd9b07d6 | |
| parent | 6543d9dca1fa48cb7df3e68e627eb0de2d748175 (diff) | |
| parent | 1d45cf8ed846e03c16018849dc359fd943ac6712 (diff) | |
| download | mullvadvpn-33ce76c1949c5e1152adff6f154bbecb1e8746f3.tar.xz mullvadvpn-33ce76c1949c5e1152adff6f154bbecb1e8746f3.zip | |
Merge branch 'fix-relay-update-timer'
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f08f974260..5aec0faa1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,10 @@ Line wrap the file at 100 chars. Th - Show a warning in the CLI if the provided location constraints don't match any known relay. ### Fixed +- Fix high CPU usage in 2020.6-beta1. This was due to an incorrectly initialized stream in the + relay list updater. +- Fix the relay list not being updated in 2020.6-beta1 after the daemon has started. + #### Android - Fix possible crash when starting the app, caused by trying to use JNI functions before the library is loaded. diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs index 82a30d3f7c..78e0292023 100644 --- a/mullvad-daemon/src/relays.rs +++ b/mullvad-daemon/src/relays.rs @@ -807,14 +807,12 @@ 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() { + if download_future.is_terminated() && self.should_update() { download_future = Box::pin(Self::download_relay_list(self.rpc_client.clone()).fuse()); self.earliest_next_try = Instant::now() + UPDATE_INTERVAL; } |
