feat(bot): ✨ Move DB initialization and Redis connection testing outside of on_ready to run.py's shard() function.
This commit is contained in:
@@ -26,6 +26,7 @@ def shard(
|
||||
shut down soon.
|
||||
"""
|
||||
|
||||
from payphone.db import setup
|
||||
from payphone.bot import bot
|
||||
from payphone.core import config
|
||||
|
||||
@@ -37,6 +38,13 @@ def shard(
|
||||
log.info("Running shard %s with default loop.", shard_id)
|
||||
|
||||
bot.loop.set_debug(True)
|
||||
|
||||
async def initialize():
|
||||
await setup.init()
|
||||
await bot.redis.ping()
|
||||
|
||||
bot.loop.run_until_complete(initialize())
|
||||
|
||||
bot.run(config.TOKEN)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user