fix: isolate auxiliary price source failures
This commit is contained in:
+10
-2
@@ -206,7 +206,11 @@ def run_scrape(force_full=False):
|
||||
price_current = metrics["price"]
|
||||
|
||||
log.info("Fetching BTC ATH...")
|
||||
ath_data = price.fetch_ath()
|
||||
try:
|
||||
ath_data = price.fetch_ath()
|
||||
except Exception as e:
|
||||
cycle_errors.append(f"ATH: {e}")
|
||||
ath_data = {}
|
||||
ath_val = ath_data.get("ath") or existing_cache.get("drawdown", {}).get("ath")
|
||||
if price_current.get("price") and ath_val:
|
||||
drawdown = price.calculate_drawdown(price_current["price"], ath_val)
|
||||
@@ -218,7 +222,11 @@ def run_scrape(force_full=False):
|
||||
metrics["drawdown"] = {"value": None}
|
||||
|
||||
log.info("Fetching historical prices for 200D SMA / Mayer...")
|
||||
hist = price.fetch_historical()
|
||||
try:
|
||||
hist = price.fetch_historical()
|
||||
except Exception as e:
|
||||
cycle_errors.append(f"Historical price: {e}")
|
||||
hist = []
|
||||
if hist:
|
||||
sma_200d = price.calculate_200d_sma(hist)
|
||||
mayer = price.calculate_mayer_multiple(price_current.get("price"), sma_200d)
|
||||
|
||||
Reference in New Issue
Block a user