Try a new create task and lower max_messages by half

This commit is contained in:
Jeremy Zhang
2019-03-05 19:38:40 +00:00
parent 725823a64c
commit ce205daa0e
2 changed files with 14 additions and 7 deletions

View File

@ -21,9 +21,14 @@ logging.getLogger('sqlalchemy')
# except raven.exceptions.InvalidDsn:
# pass
try:
create_task = asyncio.ensure_future
except AttributeError:
create_task = getattr(asyncio, 'async')
class Titan(discord.AutoShardedClient):
def __init__(self):
super().__init__(max_messages=20000)
super().__init__(max_messages=10000)
self.aiosession = aiohttp.ClientSession(loop=self.loop)
self.http.user_agent += ' TitanEmbeds-Bot'
self.redisqueue = RedisQueue(self, config["redis-uri"])
@ -63,7 +68,7 @@ class Titan(discord.AutoShardedClient):
async def start(self):
await self.redisqueue.connect()
self.loop.create_task(self.redisqueue.subscribe())
create_task(self.redisqueue.subscribe())
await super().start(config["bot-token"])
async def on_ready(self):