caching failure be not task failure

This commit is contained in:
AF 2022-10-27 14:20:38 +00:00
parent 897db8ab31
commit 848c5b70b2

View File

@ -40,7 +40,8 @@ async def cache_url(hurl: str, rurl: str, override: bool, tor: bool) -> None:
with Benchmark('CCH'): with Benchmark('CCH'):
code = await loop.run_in_executor(None, p.wait) code = await loop.run_in_executor(None, p.wait)
if code: if code:
raise RuntimeError(code) print(f'caching {hurl} failed with {code}')
return
await loop.run_in_executor(None, tmp_path.rename, path) await loop.run_in_executor(None, tmp_path.rename, path)
await cache_db.set(f'url:{hurl}', str(path)) await cache_db.set(f'url:{hurl}', str(path))
print('cached', hurl) print('cached', hurl)