Change webhook_update's task name on DEBUG command for better display

This commit is contained in:
Frisk 2024-07-25 16:32:40 +02:00
parent 935e17a8e9
commit 347cf92f6f
3 changed files with 3 additions and 1 deletions

View file

@ -139,6 +139,7 @@ async def main_loop():
# Setup database connection
await db.setup_connection()
await db.create_pubsub_interface(domains.webhook_update)
logger.debug("Connection type: {}".format(db.connection_pool))
load_extensions()
await populate_wikis()

View file

@ -215,7 +215,7 @@ class Domain:
@cache
def calculate_sleep_time(self, queue_length: int):
return max(125/queue_length, 1)
return max(int(125/queue_length), 1)
async def run_wiki_check(self):
"""Runs appropriate scheduler depending on existence of IRC"""

View file

@ -68,6 +68,7 @@ class DomainManager:
await self.return_domain(self.get_domain(split_payload[1])).get_wiki(split_payload[1]).update_targets()
logger.info("Successfully force updated information about {}".format(split_payload[1]))
elif split_payload[0] == "DEBUG":
asyncio.current_task().set_name("webhook_update")
if split_payload[1] == "INFO":
logger.info(self.domains)
for name, domain in self.domains.items():