Fixing sidecar (#20)

* Revert "CHecking stream for timeouts. (#18)"

This reverts commit d7969a8087.

* Revert "Restarting on geyser stream error (#17)"

This reverts commit 21ab222099.

* fixing minor error
This commit is contained in:
galactus 2023-12-12 11:15:38 +01:00 committed by GitHub
parent 49f519df0b
commit 88cfaeb56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 24 deletions

View File

@ -5,7 +5,6 @@ use std::{
sync::{atomic::AtomicU64, Arc},
time::Duration,
};
use yellowstone_grpc_proto_original::geyser::SubscribeRequestPing;
use crate::prometheus_sync::PrometheusSync;
use block_info::BlockInfo;
@ -137,8 +136,7 @@ pub async fn start_tracking_banking_stage_errors(
slot.store(s.slot, std::sync::atomic::Ordering::Relaxed);
}
},
_=>{
}
_=>{}
}
}
error!("geyser banking stage connection failed {}", grpc_address);
@ -189,26 +187,11 @@ async fn start_tracking_blocks(
Default::default(),
None,
Default::default(),
Some(SubscribeRequestPing { id: 0 }),
None,
)
.await
.unwrap();
loop {
let res = tokio::time::timeout(Duration::from_secs(10), geyser_stream.next()).await;
let message_res = if let Ok(message) = res {
message
} else {
// restarting geyser block subscription because of timeout
error!("Restarting geyser block subscription because of timeout");
break;
};
let message = if let Some(message) = message_res {
message
} else {
error!("Restarting geyser block subscription because it is broken");
break;
};
while let Some(message) = geyser_stream.next().await {
let Ok(message) = message else {
continue;
};

View File

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