diff options
author | 2022-06-30 19:52:33 +0100 | |
---|---|---|
committer | 2022-06-30 19:52:33 +0100 | |
commit | 259eeb84f1d935e5254acbf673144f0b98aad965 (patch) | |
tree | 0a60df03a7c35df52ee7fe3e3893c84ab16af001 /botcore | |
parent | Merge pull request #91 from python-discord/misc-bug-fixes (diff) | |
parent | Don't try to connect to statsd_url if it's None (diff) |
Merge pull request #96 from python-discord/dont-connect-statsd-if-nonev7.2.1
Diffstat (limited to 'botcore')
-rw-r--r-- | botcore/_bot.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/botcore/_bot.py b/botcore/_bot.py index ed31d624..a6362d0b 100644 --- a/botcore/_bot.py +++ b/botcore/_bot.py @@ -239,9 +239,11 @@ class BotBase(commands.Bot): # here. Normally, this shouldn't happen. await self.redis_session.connect() - # Create dummy stats client first, in case `statsd_url` is unreachable within `_connect_statsd()` + # Create dummy stats client first, in case `statsd_url` is unreachable or None self.stats = AsyncStatsClient(loop, "127.0.0.1") - self._connect_statsd(self.statsd_url, loop) + if self.statsd_url: + self._connect_statsd(self.statsd_url, loop) + await self.stats.create_socket() try: |