try fixing coro issue.
This commit is contained in:
parent
9b3237014d
commit
19f67b3679
@ -30,7 +30,7 @@ from wikiq.wiki_diff_matcher import WikiDiffMatcher
|
||||
|
||||
TO_ENCODE = ("title", "editor")
|
||||
PERSISTENCE_RADIUS = 7
|
||||
DIFF_TIMEOUT = 60*20
|
||||
DIFF_TIMEOUT = 60
|
||||
from pathlib import Path
|
||||
|
||||
import pyarrow as pa
|
||||
@ -52,8 +52,9 @@ async def diff_async(differ, last_text, text):
|
||||
return differ.inline_json_diff(last_text, text)
|
||||
try:
|
||||
result = await asyncio.wait_for(_diff(), DIFF_TIMEOUT)
|
||||
except TimeoutError as e:
|
||||
raise e
|
||||
except TimeoutError:
|
||||
print(f"WARNING! wikidiff2 timeout for rev: {row_buffer['revid'][i]}. Falling back to default limits.", file=sys.stderr)
|
||||
return
|
||||
return result
|
||||
|
||||
def calculate_persistence(tokens_added):
|
||||
@ -677,10 +678,8 @@ class WikiqParser:
|
||||
last_text = last_rev_text
|
||||
new_diffs = []
|
||||
for i, text in enumerate(row_buffer["text"]):
|
||||
try:
|
||||
diff = asyncio.run(diff_async(differ, last_text, text))
|
||||
except TimeoutError:
|
||||
print(f"WARNING! wikidiff2 timeout for rev: {row_buffer['revid'][i]}. Falling back to default limits.", file=sys.stderr)
|
||||
diff = asyncio.run(diff_async(differ, last_text, text))
|
||||
if diff is None:
|
||||
diff = fast_differ.inline_json_diff(last_text, text)
|
||||
new_diffs.append(diff)
|
||||
last_text = text
|
||||
|
Loading…
Reference in New Issue
Block a user