Fix issue with wikis not being added properly to the queue

This commit is contained in:
Frisk 2021-03-17 13:46:51 +01:00
parent a44799dff3
commit fcdf6b66cf
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -50,8 +50,8 @@ class LimitedList(list):
def __init__(self, *args): def __init__(self, *args):
list.__init__(self, *args) list.__init__(self, *args)
def append(self, obj: QueuedWiki) -> None: def append(self, obj: QueuedWiki, forced: bool = False) -> None:
if len(self) < queue_limit: if len(self) < queue_limit or forced:
self.insert(len(self), obj) self.insert(len(self), obj)
return return
raise ListFull raise ListFull
@ -174,6 +174,8 @@ class RcQueue:
current_domain["irc"].updated.remove(db_wiki["wiki"]) current_domain["irc"].updated.remove(db_wiki["wiki"])
except KeyError: except KeyError:
pass # this is to be expected when third condition is not met above pass # this is to be expected when third condition is not met above
current_domain["query"].append(QueuedWiki(db_wiki["wiki"], 20), forced=True) # avoid the queue limit and ROWID logic
continue
if not db_wiki["ROWID"] < current_domain["last_rowid"]: if not db_wiki["ROWID"] < current_domain["last_rowid"]:
current_domain["query"].append(QueuedWiki(db_wiki["wiki"], 20)) current_domain["query"].append(QueuedWiki(db_wiki["wiki"], 20))
except KeyError: except KeyError: