From 51126f226b67db44ae9516b1c8810905a49ab410 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Tue, 5 Sep 2023 19:57:31 +0100 Subject: [PATCH] Update halting logic to fetch up-to-date page contents --- kovachevbot/kovachevbot/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kovachevbot/kovachevbot/common.py b/kovachevbot/kovachevbot/common.py index 0cb6b26..0a50339 100644 --- a/kovachevbot/kovachevbot/common.py +++ b/kovachevbot/kovachevbot/common.py @@ -73,7 +73,7 @@ def links_to_plaintext(text: str) -> str: return str(parsed) -ABORT_CHECK_INTERVAL = 5 +ABORT_CHECK_INTERVAL = 15 HALT_PAGE = wikt_page("User:KovachevBot/halt") # Do not edit, please! def iterate_with_abort_check(iterator: Iterator, interval: int = ABORT_CHECK_INTERVAL, halt_page = HALT_PAGE): @@ -84,7 +84,7 @@ def iterate_with_abort_check(iterator: Iterator, interval: int = ABORT_CHECK_INT for edit_count, value in enumerate(iterator): # Check halt page if edit_count % interval == 0: - if "halt" in halt_page.text.casefold(): + if "halt" in halt_page.get(force=True).casefold(): print(f"ERROR: BOT WAS MANUALLY HALTED BY {halt_page.userName()}", file=sys.stderr) return yield value