diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-08-30 10:13:07 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-09-05 10:46:54 +0100 |
| commit | 74b7f5761956a142a0439896d42a9d8219b80f85 (patch) | |
| tree | faffa06eb0104d9c1f67341395e1bd70a48cf72d | |
| parent | ca928b4f734b589db3d315198b98c6e9fcc95353 (diff) | |
| download | mullvadvpn-74b7f5761956a142a0439896d42a9d8219b80f85.tar.xz mullvadvpn-74b7f5761956a142a0439896d42a9d8219b80f85.zip | |
Save account cache after reading it
| -rw-r--r-- | mullvad-daemon/src/account_history.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mullvad-daemon/src/account_history.rs b/mullvad-daemon/src/account_history.rs index 8455c060d2..7ba5894190 100644 --- a/mullvad-daemon/src/account_history.rs +++ b/mullvad-daemon/src/account_history.rs @@ -72,7 +72,11 @@ impl AccountHistory { Ok(accounts) => accounts, }; let file = io::BufWriter::new(reader.into_inner()); - Ok(AccountHistory { file, accounts }) + let mut history = AccountHistory { file, accounts }; + if let Err(e) = history.save_to_disk() { + log::error!("Failed to save account cache after opening it: {}", e); + } + Ok(history) } fn try_old_format(reader: &mut io::BufReader<fs::File>) -> Result<Vec<AccountToken>> { |
