Increase archiver polling timeout (#6501)

automerge
This commit is contained in:
sakridge 2019-10-22 12:15:55 -07:00 committed by Grimes
parent 45b2c138e5
commit e6438098e1
1 changed files with 9 additions and 1 deletions

View File

@ -239,6 +239,7 @@ impl Archiver {
};
let client = crate::gossip_service::get_client(&nodes);
info!("Setting up mining account...");
if let Err(e) = Self::setup_mining_account(&client, &keypair, &storage_keypair) {
//shutdown services before exiting
exit.store(true, Ordering::Relaxed);
@ -575,12 +576,19 @@ impl Archiver {
storage_keypair: &Keypair,
) -> Result<()> {
// make sure archiver has some balance
if client.poll_get_balance(&keypair.pubkey())? == 0 {
info!("checking archiver keypair...");
if client.poll_balance_with_timeout(
&keypair.pubkey(),
&Duration::from_millis(100),
&Duration::from_secs(5),
)? == 0
{
return Err(
io::Error::new(io::ErrorKind::Other, "keypair account has no balance").into(),
);
}
info!("checking storage account keypair...");
// check if the storage account exists
let balance = client.poll_get_balance(&storage_keypair.pubkey());
if balance.is_err() || balance.unwrap() == 0 {