From 02c0d1535b46922096d53967e2938bbb3a56ef82 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Sun, 28 Feb 2021 00:40:52 +0100 Subject: Add new symbols to front of queue instead of extending the end Using extend caused old items, including the ones that were requested by users and pushed to the front, to be pushed back by all of the items on the new page, possibly significantly delaying their parsing --- bot/exts/info/doc/_batch_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/info/doc/_batch_parser.py b/bot/exts/info/doc/_batch_parser.py index 9956878cf..780fb16d9 100644 --- a/bot/exts/info/doc/_batch_parser.py +++ b/bot/exts/info/doc/_batch_parser.py @@ -118,7 +118,7 @@ class BatchParser: "lxml", ) - self._queue.extend(QueueItem(item, soup) for item in self._page_doc_items[doc_item.url]) + self._queue[:0] = (QueueItem(item, soup) for item in self._page_doc_items[doc_item.url]) log.debug(f"Added items from {doc_item.url} to parse queue.") if self._parse_task is None: -- cgit v1.2.3