Skip to content

Commit

Permalink
fix(upgrade): put prompt date in the past when creating a file (#16380)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Oct 21, 2022
1 parent d461a78 commit 0e1a71f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/tools/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 0e1a71f

Please sign in to comment.