File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ # v2.5.2
8+
9+ Non-Breaking Internal Changes. (This shouldn't affect anyone.)
710
811# v2.5.0
912
Original file line number Diff line number Diff line change 2222SOFTWARE.
2323"""
2424
25- __version__ = '2.5.1 '
25+ __version__ = '2.5.2 '
2626
2727import asyncio
2828import textwrap
@@ -61,6 +61,7 @@ def __init__(self):
6161 self .threads = ThreadManager (self )
6262 self .session = aiohttp .ClientSession (loop = self .loop )
6363 self .config = ConfigManager (self )
64+ self .config_ready = asyncio .Event ()
6465 self .selfhosted = bool (self .config .get ('mongo_uri' ))
6566 if self .selfhosted :
6667 self .db = AsyncIOMotorClient (self .config .mongo_uri ).modmail_bot
@@ -177,6 +178,7 @@ async def on_connect(self):
177178 print (Fore .CYAN + 'Connected to gateway.' )
178179
179180 await self .config .refresh ()
181+ self .config_ready .set ()
180182
181183 activity_type = self .config .get ('activity_type' )
182184 message = self .config .get ('activity_message' )
@@ -203,6 +205,8 @@ async def on_ready(self):
203205 print (Fore .RED + Style .BRIGHT + 'WARNING - The GUILD_ID provided does not exist!' + Style .RESET_ALL )
204206 else :
205207 await self .threads .populate_cache ()
208+
209+ await self .config_ready .wait () # Wait until config cache is popluated with stuff from db
206210
207211 closures = self .config .closures .copy ()
208212
You can’t perform that action at this time.
0 commit comments