Compare commits
No commits in common. "ab217e247fa709d8ef262cbc382fbd83ea87ff12" and "c4bcc192417512731a98591dfd7239bb97a95df5" have entirely different histories.
ab217e247f
...
c4bcc19241
|
|
@ -283,7 +283,7 @@ async def get_candles(
|
|||
timeframe: str = Query(..., description="Candle timeframe (e.g., 5m, 1h)"),
|
||||
start: Optional[int] = Query(None, description="Start timestamp (Unix seconds)"),
|
||||
end: Optional[int] = Query(None, description="End timestamp (Unix seconds)"),
|
||||
limit: Optional[int] = Query(None, description="Maximum candles to return (omit for all)", le=10000),
|
||||
limit: Optional[int] = Query(100, description="Maximum candles to return", le=1000),
|
||||
session_id: Optional[str] = Query(
|
||||
None,
|
||||
description="Optional session ID for per-session exchange credentials",
|
||||
|
|
|
|||
|
|
@ -189,20 +189,6 @@ class CacheManager:
|
|||
source = "exchange" if exchange_candles else "memory"
|
||||
return result, source
|
||||
|
||||
# Step 2b: Handle SINCE mode (start provided, no end)
|
||||
# Gaps with end=None need to be fetched from exchange directly
|
||||
import time as time_module
|
||||
now = int(time_module.time())
|
||||
normalized_gaps = []
|
||||
for gap_start, gap_end in gaps_to_fill:
|
||||
if gap_start is not None and gap_end is None:
|
||||
# SINCE mode: fetch from start to now
|
||||
normalized_gaps.append((gap_start, now))
|
||||
elif gap_start is not None and gap_end is not None:
|
||||
normalized_gaps.append((gap_start, gap_end))
|
||||
# Skip gaps where start is None (shouldn't happen with proper request)
|
||||
gaps_to_fill = normalized_gaps if normalized_gaps else gaps_to_fill
|
||||
|
||||
db_hit = False
|
||||
exchange_hit = False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue