Add health check interval to redis connection

This commit is contained in:
Dustin Pianalto 2019-12-25 17:37:05 -09:00
parent 975dbfbeda
commit e7e90d5462

View File

@ -25,8 +25,8 @@ class Geeksbot(commands.Bot):
self.config_dir = 'geeksbot/config' self.config_dir = 'geeksbot/config'
self.config_file = 'bot_config.json' self.config_file = 'bot_config.json'
self.extension_dir = 'exts' self.extension_dir = 'exts'
self.cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=os.environ['REDIS_DB'], charset="utf-8", decode_responses=True) self.cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=os.environ['REDIS_DB'], charset="utf-8", decode_responses=True, health_check_interval=10)
self.settings_cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=1, charset="utf-8", decode_responses=True) self.settings_cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=1, charset="utf-8", decode_responses=True, health_check_interval=10)
self.token = self.settings_cache.get('DISCORD_TOKEN') self.token = self.settings_cache.get('DISCORD_TOKEN')
self.api_token = self.settings_cache.get('API_TOKEN') self.api_token = self.settings_cache.get('API_TOKEN')
self.aio_session = aiohttp.ClientSession(loop=self.loop) self.aio_session = aiohttp.ClientSession(loop=self.loop)