Let's be honest, this probably won't set anything on fire and will prevent some expensive calls

This commit is contained in:
Frisk 2021-03-18 00:10:04 +01:00
parent 7723133847
commit 9a5f57cda6
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -114,12 +114,13 @@ class RcQueue:
"""Retrives next wiki in the queue for given domain""" """Retrives next wiki in the queue for given domain"""
if len(self.domain_list[group]["query"]) == 0: if len(self.domain_list[group]["query"]) == 0:
# make sure we are not removing the group because entire domain group went down, it's expensive - yes, but could theoretically cause issues # make sure we are not removing the group because entire domain group went down, it's expensive - yes, but could theoretically cause issues
if self.check_if_domain_in_db(group): raise QueueEmpty
#logger.warning("Domain group {} has 0 elements yet there are still wikis in the db of the same domain group! This may indicate we ran over the list too fast. We are waiting...".format(group)) # if self.check_if_domain_in_db(group):
raise QueueEmpty # #logger.warning("Domain group {} has 0 elements yet there are still wikis in the db of the same domain group! This may indicate we ran over the list too fast. We are waiting...".format(group))
else: # raise QueueEmpty
await self.stop_task_group(group) # else:
return # await self.stop_task_group(group)
# return
try: try:
yield self.domain_list[group]["query"][0] yield self.domain_list[group]["query"][0]
except asyncio.CancelledError: except asyncio.CancelledError: