diff --git a/crates/accountsdb-rabbitmq/src/plugin.rs b/crates/accountsdb-rabbitmq/src/plugin.rs index 29fdd969e..7ce9d3b94 100644 --- a/crates/accountsdb-rabbitmq/src/plugin.rs +++ b/crates/accountsdb-rabbitmq/src/plugin.rs @@ -58,12 +58,11 @@ struct TokenList { impl AccountsDbPluginRabbitMq { const TOKEN_REG_URL: &'static str = "https://raw.githubusercontent.com/solana-labs/token-list/main/src/tokens/solana.tokenlist.json"; - async fn load_token_reg() -> Result> { - let res: TokenList = reqwest::get(Self::TOKEN_REG_URL) - .await + fn load_token_reg() -> Result> { + // We use `smol` as an executor, and reqwest's async backend doesn't like that + let res: TokenList = reqwest::blocking::get(Self::TOKEN_REG_URL) .map_err(custom_err)? .json() - .await .map_err(custom_err)?; res.tokens @@ -91,6 +90,8 @@ impl AccountsDbPlugin for AccountsDbPluginRabbitMq { self.acct_sel = Some(acct); self.ins_sel = Some(ins); + self.token_addresses = Self::load_token_reg()?; + smol::block_on(async { let conn = Connection::connect(&amqp.address, ConnectionProperties::default().with_smol()) @@ -105,8 +106,6 @@ impl AccountsDbPlugin for AccountsDbPluginRabbitMq { jobs.limit, )); - self.token_addresses = Self::load_token_reg().await?; - Ok(()) }) }