Cleanup db lets create a task instead

This commit is contained in:
Jeremy Zhang 2018-06-25 07:08:31 +00:00
parent 4c059c9d42
commit 316e95a103

View File

@ -86,9 +86,9 @@ class Titan(discord.AutoShardedClient):
return return
print("working on this...") 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: with self.database.get_session() as session:
guilds = session.query(Guilds).all() guilds = session.query(Guilds).all()
count = 0 count = 0