Adding timeout of 30s to resubscribe to blocks

This commit is contained in:
godmodegalactus 2023-12-14 11:51:09 +01:00
parent a862c18da5
commit 62cdda36d0
No known key found for this signature in database
GPG Key ID: 22DA4A30887FDA3C
2 changed files with 7 additions and 4 deletions

View File

@ -191,7 +191,9 @@ async fn start_tracking_blocks(
)
.await
.unwrap();
while let Some(message) = geyser_stream.next().await {
while let Ok(Some(message)) =
tokio::time::timeout(Duration::from_secs(30), geyser_stream.next()).await
{
let Ok(message) = message else {
continue;
};

View File

@ -735,9 +735,10 @@ impl Postgres {
for batch in batches {
if let Err(err) = session
.save_banking_transaction_results(batch.to_vec())
.await {
panic!("saving transaction infos failed {}", err);
}
.await
{
panic!("saving transaction infos failed {}", err);
}
}
}
}