diff options
author | 2022-07-27 18:34:50 +0100 | |
---|---|---|
committer | 2022-07-27 18:34:50 +0100 | |
commit | db0ff48a574f5b466f3e8dc25cc32c3a9bfc1370 (patch) | |
tree | dfc700150ebb4ff0700ca6160fe084b7dac7a892 /botcore/_bot.py | |
parent | Fix suppressed_exceptions type hint (#112) (diff) | |
parent | Bump sphinx to 5.1.1 (diff) |
Merge pull request #114 from python-discord/8.0.0-betav8.0.0
Diffstat (limited to 'botcore/_bot.py')
-rw-r--r-- | botcore/_bot.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/botcore/_bot.py b/botcore/_bot.py index 8bea4385..bb25c0b5 100644 --- a/botcore/_bot.py +++ b/botcore/_bot.py @@ -234,10 +234,10 @@ class BotBase(commands.Bot): ) self.http.connector = self._connector - if getattr(self, "redis_session", False) and self.redis_session.closed: + if getattr(self, "redis_session", False) and not self.redis_session.valid: # If the RedisSession was somehow closed, we try to reconnect it # here. Normally, this shouldn't happen. - await self.redis_session.connect() + await self.redis_session.connect(ping=True) # Create dummy stats client first, in case `statsd_url` is unreachable or None self.stats = AsyncStatsClient(loop, "127.0.0.1") @@ -284,8 +284,5 @@ class BotBase(commands.Bot): if getattr(self.stats, "_transport", False): self.stats._transport.close() - if getattr(self, "redis_session", False): - await self.redis_session.close() - if self._statsd_timerhandle: self._statsd_timerhandle.cancel() |