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):
#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))
raise QueueEmpty raise QueueEmpty
else: # if self.check_if_domain_in_db(group):
await self.stop_task_group(group) # #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))
return # raise QueueEmpty
# else:
# 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: