Data Observatory: add more logging for coingecko API failures
This commit is contained in:
Generated
+1
-1
@@ -6209,7 +6209,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-data-observatory"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-data-observatory"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
|
||||
@@ -29,10 +29,16 @@ impl PriceScraper {
|
||||
async fn get_coingecko_prices(&self) -> anyhow::Result<CoingeckoPriceResponse> {
|
||||
tracing::info!("💰 Fetching CoinGecko prices from {COINGECKO_API_URL}");
|
||||
|
||||
let response = reqwest::get(COINGECKO_API_URL)
|
||||
.await?
|
||||
.json::<CoingeckoPriceResponse>()
|
||||
.await;
|
||||
let response = reqwest::get(COINGECKO_API_URL).await?;
|
||||
|
||||
if !response.status().is_success() {
|
||||
tracing::error!(
|
||||
"CoinGecko price query returned error: {}",
|
||||
response.status()
|
||||
);
|
||||
}
|
||||
|
||||
let response = response.json::<CoingeckoPriceResponse>().await;
|
||||
|
||||
tracing::info!("Got response {:?}", response);
|
||||
match response {
|
||||
|
||||
Reference in New Issue
Block a user