fix error loggging.
This commit is contained in:
parent
a1f94078c4
commit
3a480940e9
@ -49,12 +49,12 @@ class PersistMethod:
|
|||||||
|
|
||||||
async def diff_async(differ, last_text, text):
|
async def diff_async(differ, last_text, text):
|
||||||
try:
|
try:
|
||||||
|
loop = asyncio.get_running_loop()
|
||||||
return await asyncio.wait_for(
|
return await asyncio.wait_for(
|
||||||
asyncio.to_thread(differ.inline_json_diff, last_text, text),
|
asyncio.to_thread(differ.inline_json_diff, last_text, text),
|
||||||
timeout=DIFF_TIMEOUT
|
timeout=DIFF_TIMEOUT
|
||||||
)
|
)
|
||||||
except TimeoutError:
|
except TimeoutError as e:
|
||||||
print(f"WARNING! wikidiff2 timeout for rev: {row_buffer['revid'][i]}. Falling back to default limits.", file=sys.stderr)
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@ -681,6 +681,7 @@ class WikiqParser:
|
|||||||
for i, text in enumerate(row_buffer["text"]):
|
for i, text in enumerate(row_buffer["text"]):
|
||||||
diff = asyncio.run(diff_async(differ, last_text, text))
|
diff = asyncio.run(diff_async(differ, last_text, text))
|
||||||
if diff is None:
|
if diff is None:
|
||||||
|
print(f"WARNING! wikidiff2 timeout for rev: {row_buffer['revid'][i]}. Falling back to default limits.", file=sys.stderr)
|
||||||
diff = fast_differ.inline_json_diff(last_text, text)
|
diff = fast_differ.inline_json_diff(last_text, text)
|
||||||
new_diffs.append(diff)
|
new_diffs.append(diff)
|
||||||
last_text = text
|
last_text = text
|
||||||
|
Loading…
Reference in New Issue
Block a user