This commit is contained in:
@@ -623,6 +623,7 @@ class AnalyticsWorker:
|
|||||||
|
|
||||||
def get_missing_dates(self) -> List[datetime.date]:
|
def get_missing_dates(self) -> List[datetime.date]:
|
||||||
"""Ermittelt fehlende Tage, die noch berechnet werden müssen"""
|
"""Ermittelt fehlende Tage, die noch berechnet werden müssen"""
|
||||||
|
logger.info("=== get_missing_dates() called ===")
|
||||||
# Hole das Datum des ersten Trades
|
# Hole das Datum des ersten Trades
|
||||||
query = "select min(date_trunc('day', timestamp)) as first_date from trades"
|
query = "select min(date_trunc('day', timestamp)) as first_date from trades"
|
||||||
data = self.query_questdb(query)
|
data = self.query_questdb(query)
|
||||||
@@ -661,7 +662,9 @@ class AnalyticsWorker:
|
|||||||
# Finde fehlende Tage
|
# Finde fehlende Tage
|
||||||
missing_dates = [d for d in all_dates if d not in existing_dates]
|
missing_dates = [d for d in all_dates if d not in existing_dates]
|
||||||
|
|
||||||
logger.info(f"Date range: first trade={first_date}, last trade={last_trade_date}, today={today}")
|
# Debug-Logs (immer ausgeben)
|
||||||
|
last_trade_str = str(last_trade_date) if last_trade_date else "None"
|
||||||
|
logger.info(f"Date range: first trade={first_date}, last trade={last_trade_str}, today={today}")
|
||||||
logger.info(f"Existing dates in analytics_custom: {len(existing_dates)} dates")
|
logger.info(f"Existing dates in analytics_custom: {len(existing_dates)} dates")
|
||||||
if existing_dates:
|
if existing_dates:
|
||||||
existing_sorted = sorted(existing_dates)
|
existing_sorted = sorted(existing_dates)
|
||||||
@@ -669,6 +672,8 @@ class AnalyticsWorker:
|
|||||||
logger.info(f"Found {len(missing_dates)} missing dates to calculate (from {len(all_dates)} total dates)")
|
logger.info(f"Found {len(missing_dates)} missing dates to calculate (from {len(all_dates)} total dates)")
|
||||||
if missing_dates:
|
if missing_dates:
|
||||||
logger.info(f" First missing: {missing_dates[0]}, Last missing: {missing_dates[-1]}")
|
logger.info(f" First missing: {missing_dates[0]}, Last missing: {missing_dates[-1]}")
|
||||||
|
else:
|
||||||
|
logger.info(" No missing dates - all dates are already calculated")
|
||||||
|
|
||||||
return sorted(missing_dates)
|
return sorted(missing_dates)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user