jenkins-bot submitted this change.

View Change

Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
[IMPR] Use site.maxlimit to determine the highest limit to load

Bug: T299859
Change-Id: I64631e2d50e4ee1aa23dd491db936213e8253e8e
---
M scripts/redirect.py
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/scripts/redirect.py b/scripts/redirect.py
index 8aa1b9e..21e1f1a 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -214,15 +214,12 @@

def _next_redirect_group(self) -> Generator[List[pywikibot.Page], None,
None]:
- """Generator that yields batches of 50 redirects as a list."""
+ """Generator that yields batches of redirects as a list."""
chunk = []
- chunks = 0
for page in self.get_redirect_pages_via_api():
chunk.append(str(page.pageid))
- if len(chunk) >= 50: # T299859
- chunks += 1
- if not chunks % 10:
- pywikibot.output('.', newline=False)
+ if len(chunk) >= self.site.maxlimit:
+ pywikibot.output('.', newline=False)
yield chunk
chunk.clear()
if chunk:

To view, visit change 761583. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I64631e2d50e4ee1aa23dd491db936213e8253e8e
Gerrit-Change-Number: 761583
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged