run_scan
Documentation for eth_defi.neutral_trade.metrics.run_scan function.
- run_scan(db, api_key, *, max_workers=2, page_budget=100, time_budget=300, vault_ids=None, start_date=None, end_date=None, refresh=False)
Discover leads, refresh current metadata and resume bounded history.
Manual/full and scheduled/incremental modes use this same routine. Daily histories use independent eligibility; current metrics refresh every run.
- Parameters
db (eth_defi.neutral_trade.metrics.NeutralTradeDatabase) – Owner-thread private database under its source lock.
api_key (str) – Partner credential.
max_workers (int) – Threaded page-reader concurrency.
page_budget (int) – Maximum committed/attempted pages this invocation.
time_budget (float) – Time before stopping new page dispatches.
vault_ids (Optional[set[str]]) – Optional exact source IDs; exclusions still apply.
start_date (Optional[datetime.date]) – Optional inclusive historical start.
end_date (Optional[datetime.date]) – Optional fixed end, default today in UTC.
refresh (bool) – Reopen completed histories for a full refresh.
- Returns
Counts distinguishing failures, pending work and completion.
- Return type