From 44fc8136af4dbcfcb9ccd0d54d2cfe33d2c4f2b4 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 31 Jan 2024 09:44:28 -0800 Subject: [PATCH] Add TODO comment as a follow-up to #9 --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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