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

View File

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