Skip to content

Commit

Permalink
cli: fix serve-web needs to wait a certain amount of time after machi…
Browse files Browse the repository at this point in the history
…ne startup (microsoft#236427)

Fixes microsoft#233155
  • Loading branch information
connor4312 authored Dec 18, 2024
1 parent 2a4ed84 commit 3e86f1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/src/commands/serve_web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 3e86f1e

Please sign in to comment.