fix(bot): 🐛 Add timeout to Redis sockets.
This commit is contained in:
+5
-1
@@ -32,7 +32,11 @@ class Payphone(commands.AutoShardedBot):
|
||||
log = logging.logger
|
||||
|
||||
redis: aredis.Redis = aredis.Redis(
|
||||
host="localhost" if config.IS_DEBUG else "redis.default.svc.cluster.local"
|
||||
host="localhost" if config.IS_DEBUG else "redis",
|
||||
connection_pool=aredis.ConnectionPool(
|
||||
socket_timeout=3,
|
||||
socket_connection_timeout=10
|
||||
)
|
||||
)
|
||||
|
||||
def __init__(self) -> None:
|
||||
|
||||
@@ -17,7 +17,7 @@ class Admin(base.Cog):
|
||||
self.bot = bot_instance
|
||||
|
||||
self.update_leaderboard.add_exception_type(exceptions.ConfigurationError)
|
||||
# self.update_leaderboard.start()
|
||||
self.update_leaderboard.start()
|
||||
|
||||
def cog_unload(self) -> None:
|
||||
self.update_leaderboard.cancel()
|
||||
|
||||
@@ -23,7 +23,7 @@ class Users(base.Cog):
|
||||
self.bot = bot_instance
|
||||
|
||||
self.update_leaderboard.add_exception_type(exceptions.ConfigurationError)
|
||||
# self.update_leaderboard.start()
|
||||
self.update_leaderboard.start()
|
||||
|
||||
def cog_unload(self) -> None:
|
||||
self.update_leaderboard.cancel()
|
||||
|
||||
Reference in New Issue
Block a user