Skip to content

Commit

Permalink
Slightly delay sync_recompute to avoid race condition on Undo Send logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Jan 9, 2025
1 parent 87d1ba0 commit 4cab48d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gossip-lib/src/feed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ impl Feed {
/// is useful to recompute it right away.
pub fn sync_recompute(&self) {
task::spawn(async move {
// Wait 0.05 seconds first to avoid race conditions
tokio::time::sleep(Duration::new(0, 50_000_000)).await;

if let Err(e) = GLOBALS.feed.recompute().await {
tracing::error!("{}", e);
}
Expand Down

0 comments on commit 4cab48d

Please sign in to comment.