From 6fb4b8c8e15adda4cbcfc692e49af74589ce41d8 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Thu, 30 Jun 2022 19:21:41 +0100 Subject: Don't try to connect to statsd_url if it's None --- botcore/_bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'botcore/_bot.py') 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: -- cgit v1.2.3