1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(upgrade): put prompt date in the past when creating a file (#16380)

This commit is contained in:
Bartek Iwańczuk 2022-10-21 17:07:17 +02:00 committed by GitHub
parent d461a784b2
commit 0e1a71fec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
};