fix interruption handling by breaking the diff loop.
This commit is contained in:
@@ -875,6 +875,8 @@ class WikiqParser:
|
||||
new_diffs = []
|
||||
diff_timeouts = []
|
||||
for i, text in enumerate(row_buffer["text"]):
|
||||
if self.shutdown_requested:
|
||||
break
|
||||
diff, timed_out = diff_with_timeout(differ, last_text, text)
|
||||
if timed_out:
|
||||
print(f"WARNING! wikidiff2 timeout for rev: {row_buffer['revid'][i]}. Falling back to default limits.", file=sys.stderr)
|
||||
@@ -882,6 +884,9 @@ class WikiqParser:
|
||||
new_diffs.append(diff)
|
||||
diff_timeouts.append(timed_out)
|
||||
last_text = text
|
||||
if self.shutdown_requested:
|
||||
print("Shutdown requested, closing writers...", file=sys.stderr)
|
||||
break
|
||||
row_buffer["diff"] = [
|
||||
[
|
||||
entry
|
||||
|
||||
Reference in New Issue
Block a user