fix asyncio bug.
This commit is contained in:
parent
19f67b3679
commit
329d682f4c
@ -48,10 +48,11 @@ class PersistMethod:
|
||||
|
||||
|
||||
async def diff_async(differ, last_text, text):
|
||||
async def _diff():
|
||||
return differ.inline_json_diff(last_text, text)
|
||||
try:
|
||||
result = await asyncio.wait_for(_diff(), DIFF_TIMEOUT)
|
||||
result = await asyncio.wait_for(
|
||||
asyncio.to_thread(differ.inline_json_diff, last_text, text),
|
||||
timeout=DIFF_TIMEOUT
|
||||
)
|
||||
except TimeoutError:
|
||||
print(f"WARNING! wikidiff2 timeout for rev: {row_buffer['revid'][i]}. Falling back to default limits.", file=sys.stderr)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user