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:
Jonathan
2026-07-10 23:12:33 +02:00
parent 6ea930ec7a
commit cf5632aa5f
2 changed files with 41 additions and 1 deletions
+6 -1
View File
@@ -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)