Skip to content

Commit

Permalink
Don't spin in rrd-decoder if we can't see time passing
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed May 11, 2023
1 parent 96c035a commit cafe140
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/re_log_encoding/src/stream_rrd_from_http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ mod web_decode {
}
}

if last_yield.elapsed() > web_time::Duration::from_millis(10) {
// If no time has passed, we also yield. This likely means there is some
// kind of browser bug preventing us from observing the passage of time,
// and we don't want to just spin forever.
if last_yield.elapsed() > web_time::Duration::from_millis(10)
|| last_yield.elapsed() == web_time::Duration::ZERO
{
// yield to the ui task
yield_().await;
last_yield = web_time::Instant::now();
Expand Down

0 comments on commit cafe140

Please sign in to comment.