fix: isolate per-adapter search failures in the pipeline match loop
Wrap each adapter's search() call in the match stage in try/except so a down source (dead slskd, Qobuz auth error, etc.) contributes no candidates instead of crashing run_pipeline and killing the worker.
This commit is contained in:
@@ -126,7 +126,12 @@ def run_pipeline(
|
||||
_set_state(conn, job_id, "matching", "match")
|
||||
found: list[Candidate] = []
|
||||
for adapter in adapters:
|
||||
for c in adapter.search(target):
|
||||
try:
|
||||
results = adapter.search(target)
|
||||
except Exception as e: # a down source contributes no candidates, never crashes the job
|
||||
print(f"pipeline: adapter {adapter.name} search failed: {e}", flush=True)
|
||||
continue
|
||||
for c in results:
|
||||
found.append(replace(c, source_tier=adapter.tier, confidence=score_confidence(target, c)))
|
||||
_persist_candidates(conn, job_id, found)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user