diff options
author | Zuul <zuul@review.opendev.org> | 2023-02-17 13:27:20 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-02-17 13:27:20 +0000 |
commit | e5e572ab8e407d2779b96d3aac333713f79b3533 (patch) | |
tree | 747619570f48246d056b7fdf700f71fb30aec58a | |
parent | 5bcac4c7d4503be8161bcf159981199e3ea89d4d (diff) | |
parent | 4ff2d00178c1c5f3fe65c0ba6b0986df618cab78 (diff) | |
download | taskflow-e5e572ab8e407d2779b96d3aac333713f79b3533.tar.gz |
Merge "Change StrictRedis usage to Redis"
-rw-r--r-- | releasenotes/notes/remove-strict-redis-f2a5a924b314de41.yaml | 4 | ||||
-rw-r--r-- | taskflow/tests/utils.py | 2 | ||||
-rw-r--r-- | taskflow/utils/redis_utils.py | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/releasenotes/notes/remove-strict-redis-f2a5a924b314de41.yaml b/releasenotes/notes/remove-strict-redis-f2a5a924b314de41.yaml new file mode 100644 index 0000000..c11467c --- /dev/null +++ b/releasenotes/notes/remove-strict-redis-f2a5a924b314de41.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + The minimum redis-py version required is now >= 3.0.0 diff --git a/taskflow/tests/utils.py b/taskflow/tests/utils.py index 6c2f13a..2b02759 100644 --- a/taskflow/tests/utils.py +++ b/taskflow/tests/utils.py @@ -77,7 +77,7 @@ def zookeeper_available(min_version, timeout=3): def redis_available(min_version): - client = redis.StrictRedis() + client = redis.Redis() try: client.ping() except Exception: diff --git a/taskflow/utils/redis_utils.py b/taskflow/utils/redis_utils.py index 373ab2d..279d962 100644 --- a/taskflow/utils/redis_utils.py +++ b/taskflow/utils/redis_utils.py @@ -33,7 +33,7 @@ def _raise_on_closed(meth): return wrapper -class RedisClient(redis.StrictRedis): +class RedisClient(redis.Redis): """A redis client that can be closed (and raises on-usage after closed). TODO(harlowja): if https://github.com/andymccurdy/redis-py/issues/613 ever @@ -48,9 +48,9 @@ class RedisClient(redis.StrictRedis): self.closed = True self.connection_pool.disconnect() - execute_command = _raise_on_closed(redis.StrictRedis.execute_command) - transaction = _raise_on_closed(redis.StrictRedis.transaction) - pubsub = _raise_on_closed(redis.StrictRedis.pubsub) + execute_command = _raise_on_closed(redis.Redis.execute_command) + transaction = _raise_on_closed(redis.Redis.transaction) + pubsub = _raise_on_closed(redis.Redis.pubsub) class UnknownExpire(enum.IntEnum): |