diff options
author | Tobias Urdin <tobias.urdin@binero.com> | 2022-09-28 12:21:46 +0200 |
---|---|---|
committer | Tobias Urdin <tobias.urdin@binero.com> | 2022-09-29 08:37:05 +0000 |
commit | 4ff2d00178c1c5f3fe65c0ba6b0986df618cab78 (patch) | |
tree | f58386d2ebb31e527299d540bb9b77cadf25b8fa | |
parent | 4bd0ab33272064cc4e44fe2d652ecf7a11b07274 (diff) | |
download | taskflow-4ff2d00178c1c5f3fe65c0ba6b0986df618cab78.tar.gz |
Change StrictRedis usage to Redis
The StrictRedis class is only an alias for
Redis in >= 3.0.0
Change-Id: Ief27531f120a50805053c214cb61bb4151678d70
-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 58cd9ab..bbd4678 100644 --- a/taskflow/tests/utils.py +++ b/taskflow/tests/utils.py @@ -78,7 +78,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 0d04073..aa9b143 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): |