report per-ticker R:R scanner progress (sidebar stuck at 0%)
Deploy / lint (push) Successful in 6s
Deploy / test (push) Successful in 34s
Deploy / deploy (push) Successful in 23s

scan_rr set the total then called scan_all_tickers as one opaque await, so the
runtime snapshot's processed count stayed 0 until the whole scan finished and
jumped straight to 100%. scan_all_tickers now takes an optional progress_callback
invoked per ticker; the scheduler wires it to _runtime_progress so the sidebar's
live indicator advances as tickers are scanned.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 14:59:28 +02:00
parent 90618d186f
commit 801df41b4d
2 changed files with 20 additions and 2 deletions
+6
View File
@@ -654,9 +654,15 @@ async def scan_rr() -> None:
total = len(symbols)
_runtime_progress(job_name, processed=0, total=total)
def _on_progress(done: int, count: int, symbol: str) -> None:
_runtime_progress(
job_name, processed=done, total=count, current_ticker=symbol or None
)
try:
setups = await scan_all_tickers(
db, rr_threshold=settings.default_rr_threshold,
progress_callback=_on_progress,
)
processed = total or 0
_runtime_finish(job_name, "completed", processed=processed, total=total, message=f"Found {len(setups)} setups")