Skip to content

Commit

Permalink
feat(propdefs): try not to sleep in the hot loop, eh (#24658)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverb123 authored Aug 28, 2024
1 parent 3800952 commit 934813d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/property-defs-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ async fn spawn_producer_loop(
sent.insert(update.clone());
match channel.try_send(update) {
Ok(_) => {}
Err(TrySendError::Full(_)) => {
Err(TrySendError::Full(update)) => {
warn!("Worker blocked");
metrics::counter!(WORKER_BLOCKED).increment(1);
tokio::time::sleep(Duration::from_secs(1)).await;
channel.send(update).await.unwrap();
}
Err(e) => {
warn!("Coordinator send failed: {:?}", e);
Expand Down

0 comments on commit 934813d

Please sign in to comment.