Add get_next_last_id
This commit is contained in:
parent
c3ad0eebec
commit
0e8540417f
|
@ -262,6 +262,19 @@ impl ThinClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Request a new last Entry ID from the server. This method blocks
|
||||||
|
/// until the server sends a response.
|
||||||
|
pub fn get_next_last_id(&mut self, previous_last_id: &Hash) -> Hash {
|
||||||
|
loop {
|
||||||
|
let last_id = self.get_last_id();
|
||||||
|
if last_id != *previous_last_id {
|
||||||
|
break last_id;
|
||||||
|
}
|
||||||
|
debug!("Got same last_id ({:?}), will retry...", last_id);
|
||||||
|
sleep(Duration::from_millis(100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn submit_poll_balance_metrics(elapsed: &Duration) {
|
pub fn submit_poll_balance_metrics(elapsed: &Duration) {
|
||||||
solana_metrics::submit(
|
solana_metrics::submit(
|
||||||
influxdb::Point::new("thinclient")
|
influxdb::Point::new("thinclient")
|
||||||
|
|
Loading…
Reference in New Issue