Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #260 Use redis-py's RedisCluster instead of redis-py-cluster #261

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions redbeat/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ def get_redis(app=None):
ssl_options.update(conf.redis_use_ssl)
connection = StrictRedis.from_url(conf.redis_url, decode_responses=True, **ssl_options)
elif conf.redis_url.startswith('redis-cluster'):
from rediscluster import RedisCluster

if not redis_options.get('startup_nodes'):
redis_options = {'startup_nodes': [{"host": "localhost", "port": "30001"}]}
connection = RedisCluster(decode_responses=True, **redis_options)
from redis.cluster import RedisCluster
connection = RedisCluster.from_url(
conf.redis_url.replace("redis-cluster://", "redis://"),
decode_responses=True,
**redis_options,
)
else:
connection = StrictRedis.from_url(conf.redis_url, decode_responses=True)

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ black
celery>=5.0
fakeredis>=1.0.3
python-dateutil
redis>=3.2
redis>=4.1
tenacity
twine
wheel
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'Operating System :: OS Independent',
],
install_requires=[
'redis>=3.2',
'redis>=4.1',
'celery>=5.0',
'python-dateutil',
'tenacity',
Expand Down
Loading