run_scan
Documentation for eth_defi.apex.metrics.run_scan function.
- run_scan(session_pool, database, *, vault_ids=None, max_workers=8, history_mode='incremental', history_refresh_interval=datetime.timedelta(days=1), ranking_timeout=300.0, history_timeout=120.0)
Run one complete ApeX ranking observation and due history maintenance.
Ranking is always fetched and validated in full before a target filter is applied. The command scheduler owns ranking cadence; this function records all selected non-terminal vaults whenever called. Historical maintenance is independently gated by persisted success timestamps.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured worker-local HTTP session pool.
database (eth_defi.apex.metrics.ApexMetricsDatabase) – Already-open owner-thread database.
vault_ids (Optional[tuple[str, ...]]) – Optional exact targeted IDs.
max_workers (int) – Threaded history reader count.
history_mode (Literal['incremental', 'refresh', 'none']) –
incremental,refreshornone.history_refresh_interval (datetime.timedelta) – Positive independent historical refresh cadence.
ranking_timeout (float) – Whole two-pass ranking deadline in seconds.
history_timeout (float) – Per-vault history deadline in seconds.
- Returns
Typed completed-scan summary.
- Return type