Skip to content

Commit 0e1a71f

Browse files
authored
fix(upgrade): put prompt date in the past when creating a file (#16380)
1 parent d461a78 commit 0e1a71f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli/tools/upgrade.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use once_cell::sync::Lazy;
1515
use std::env;
1616
use std::fs;
1717
use std::io::Write;
18+
use std::ops::Sub;
1819
use std::path::Path;
1920
use std::path::PathBuf;
2021
use std::process::Command;
@@ -75,7 +76,9 @@ pub fn check_for_upgrades(cache_dir: PathBuf) {
7576
};
7677

7778
let file = CheckVersionFile {
78-
last_prompt: chrono::Utc::now(),
79+
// put a date in the past here so that prompt can be shown on next run
80+
last_prompt: chrono::Utc::now()
81+
.sub(chrono::Duration::hours(UPGRADE_CHECK_INTERVAL + 1)),
7982
last_checked: chrono::Utc::now(),
8083
latest_version,
8184
};

0 commit comments

Comments
 (0)