diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-10-21 17:07:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 17:07:17 +0200 |
commit | 0e1a71fec6fff5fe62d7e6b2bfffb7ab877d7b71 (patch) | |
tree | 5c375949f56e3ba08b2831c1d3967cb5a6951c7e | |
parent | d461a784b2696141a6a0f336b26d9dc2f17fb3b7 (diff) |
fix(upgrade): put prompt date in the past when creating a file (#16380)
-rw-r--r-- | cli/tools/upgrade.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs index 2864cdbe2..8adb102aa 100644 --- a/cli/tools/upgrade.rs +++ b/cli/tools/upgrade.rs @@ -15,6 +15,7 @@ use once_cell::sync::Lazy; use std::env; use std::fs; use std::io::Write; +use std::ops::Sub; use std::path::Path; use std::path::PathBuf; use std::process::Command; @@ -75,7 +76,9 @@ pub fn check_for_upgrades(cache_dir: PathBuf) { }; let file = CheckVersionFile { - last_prompt: chrono::Utc::now(), + // put a date in the past here so that prompt can be shown on next run + last_prompt: chrono::Utc::now() + .sub(chrono::Duration::hours(UPGRADE_CHECK_INTERVAL + 1)), last_checked: chrono::Utc::now(), latest_version, }; |