Merge pull request #1988 from ryankask/fix-redis-conn-logging

Copy client connection kwargs before mutating
This commit is contained in:
Alexandre Flament 2022-11-29 19:38:54 +01:00 committed by GitHub
commit 768659f2bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,7 +47,7 @@ def initialize():
_CLIENT = redis.Redis.from_url(redis_url)
# log the parameters as seen by the redis lib, without the password
kwargs = _CLIENT.get_connection_kwargs()
kwargs = _CLIENT.get_connection_kwargs().copy()
kwargs.pop('password', None)
kwargs = ' '.join([f'{k}={v!r}' for k, v in kwargs.items()])
logger.info("connecting to Redis %s", kwargs)