diff --git a/src/main.rs b/src/main.rs index 71bfacc..d37dfb2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,7 +140,10 @@ async fn retry_get_historical_price( return price; } println!("Retry get_historical_price"); - //empirically observed cool down period is ~14s + // Empirically observed cool down period is ~14s + // + // TODO: Move this retry logic into `coin_gecko::get_historical_price()`, and respect the + // HTTP `Retry-After:` response header from Coin Gecko sleep(Duration::from_secs(5)); } token.get_historical_price(rpc_client, block_date).await