to_thread
This commit is contained in:
parent
5f2632a58a
commit
618b8a3cea
@ -36,8 +36,7 @@ async def cache_url(hurl: str, rurl: str, override: bool, tor: bool) -> None:
|
|||||||
if code:
|
if code:
|
||||||
print(f'caching {hurl} failed with {code}')
|
print(f'caching {hurl} failed with {code}')
|
||||||
return
|
return
|
||||||
loop = asyncio.get_running_loop()
|
await asyncio.to_thread(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)
|
||||||
# await cache_db.set(f'cachable:{hurl}', False)
|
# await cache_db.set(f'cachable:{hurl}', False)
|
||||||
|
Loading…
Reference in New Issue
Block a user