change log levels

This commit is contained in:
GroovieGermanikus 2023-12-15 10:34:05 +01:00
parent 5c9a43785b
commit 16d9019f25
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
1 changed files with 16 additions and 18 deletions

View File

@ -1,6 +1,6 @@
use async_stream::stream;
use futures::{Stream, StreamExt};
use log::{info, warn};
use log::{debug, info, trace, warn};
use solana_sdk::commitment_config::CommitmentConfig;
use std::collections::HashMap;
use std::pin::Pin;
@ -146,24 +146,22 @@ pub fn create_geyser_reconnecting_stream(
}
ConnectionState::Ready(mut geyser_stream) => {
//for await update_message in geyser_stream {
match geyser_stream.next().await {
Some(Ok(update_message)) => {
info!(">message on {}", label);
(ConnectionState::Ready(geyser_stream), Some(update_message))
}
Some(Err(tonic_status)) => {
// TODO identify non-recoverable errors and cancel stream
warn!("Receive error on {} - retrying: {:?}", label, tonic_status);
(ConnectionState::WaitReconnect, None)
}
None => {
//TODO should not arrive. Mean the stream close.
warn!("Geyzer stream close on {} - retrying", label);
(ConnectionState::WaitReconnect, None)
}
match geyser_stream.next().await {
Some(Ok(update_message)) => {
trace!("> update message on {}", label);
(ConnectionState::Ready(geyser_stream), Some(update_message))
}
//} // -- production loop
Some(Err(tonic_status)) => {
// TODO identify non-recoverable errors and cancel stream
debug!("! error on {} - retrying: {:?}", label, tonic_status);
(ConnectionState::WaitReconnect, None)
}
None => {
//TODO should not arrive. Mean the stream close.
warn!("! geyser stream closed on {} - retrying", label);
(ConnectionState::WaitReconnect, None)
}
}
}
ConnectionState::WaitReconnect => {