41 redis_url = get_setting(
'redis.url')
46 _CLIENT = redis.Redis.from_url(redis_url)
49 kwargs = _CLIENT.get_connection_kwargs().copy()
50 kwargs.pop(
'password',
None)
51 kwargs =
' '.join([f
'{k}={v!r}' for k, v
in kwargs.items()])
52 logger.info(
"connecting to Redis %s", kwargs)
58 logger.info(
"connected to Redis")
60 except redis.exceptions.RedisError
as e:
62 _pw = pwd.getpwuid(os.getuid())
63 logger.exception(
"[%s (%s)] can't connect redis DB ...", _pw.pw_name, _pw.pw_uid)
64 if redis_url == OLD_REDIS_URL_DEFAULT_URL
and isinstance(e, redis.exceptions.ConnectionError):
66 "You can safely ignore the above Redis error if you don't use Redis. "
67 "You can remove this error by setting redis.url to false in your settings.yml."