Add a sleep statement to Batch publication errors to prevent log flooding/node hammering

This commit is contained in:
Luke Parker 2023-10-12 18:39:46 -04:00
parent f847ac7077
commit f25f5cd368
No known key found for this signature in database

View file

@ -761,6 +761,8 @@ async fn handle_processor_messages<D: Db, Pro: Processors, P: P2p>(
);
// If we failed to publish it, restore it
batches.push_front(batch);
// Sleep for a few seconds before retrying to prevent hammering the node
tokio::time::sleep(Duration::from_secs(5)).await;
}
}