aboutsummaryrefslogtreecommitdiffstats
path: root/botcore/_bot.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-06-30 19:21:41 +0100
committerGravatar Chris Lovering <[email protected]>2022-06-30 19:29:34 +0100
commit6fb4b8c8e15adda4cbcfc692e49af74589ce41d8 (patch)
tree0a60df03a7c35df52ee7fe3e3893c84ab16af001 /botcore/_bot.py
parentMerge pull request #91 from python-discord/misc-bug-fixes (diff)
Don't try to connect to statsd_url if it's None
Diffstat (limited to 'botcore/_bot.py')
-rw-r--r--botcore/_bot.py6
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: