cli: fix serve-web needs to wait a certain amount of time after machine startup (#236427)

Fixes #233155
pull/236433/head
Connor Peet 2024-12-17 16:38:47 -08:00 committed by GitHub
parent 2a4ed84748
commit 3e86f1e6cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -548,9 +548,11 @@ impl ConnectionManager {
Err(_) => Quality::Stable,
});
let now = Instant::now();
let latest_version = tokio::sync::Mutex::new(cache.get().first().map(|latest_commit| {
(
Instant::now() - Duration::from_secs(RELEASE_CHECK_INTERVAL),
now.checked_sub(Duration::from_secs(RELEASE_CHECK_INTERVAL))
.unwrap_or(now), // handle 0-ish instants, #233155
Release {
name: String::from("0.0.0"), // Version information not stored on cache
commit: latest_commit.clone(),