Bug Fix: More robustly test if two Redis clients talk to the same database
Previously, we were comparing the two clients' connection_kwargs
, but connection_kwargs
contains more than just host
, port
, and db
:
>>> from redis import Redis
>>> redis = Redis()
>>> redis.connection_pool.connection_kwargs
{'db': 0, 'username': None, 'password': None, 'socket_timeout': None, 'encoding': 'utf-8', 'encoding_errors': 'strict', 'decode_responses': False, 'retry_on_error': [], 'retry': None, 'health_check_interval': 0, 'client_name': None, 'redis_connect_func': None, 'host': 'localhost', 'port': 6379, 'socket_connect_timeout': None, 'socket_keepalive': None, 'socket_keepalive_options': None}
This PR allows Pottery to recognize that two Redis clients are connected to the same database even if their socket timeout our retry policies are different.