From 316e95a1039406c6d796e225baf26e268fac2c66 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Mon, 25 Jun 2018 07:08:31 +0000 Subject: [PATCH] Cleanup db lets create a task instead --- discordbot/cleanup_db_messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discordbot/cleanup_db_messages.py b/discordbot/cleanup_db_messages.py index aa13dae..d363af9 100644 --- a/discordbot/cleanup_db_messages.py +++ b/discordbot/cleanup_db_messages.py @@ -86,9 +86,9 @@ class Titan(discord.AutoShardedClient): return print("working on this...") - self.loop.run_in_executor(None, self.start_cleanup) + self.loop.create_task(self.start_cleanup()) - def start_cleanup(self): + async def start_cleanup(self): with self.database.get_session() as session: guilds = session.query(Guilds).all() count = 0