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

add queue_class to REDIS_ALLOWED_KEYS #2577

Merged
merged 4 commits into from Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions redis/cluster.py
Expand Up @@ -135,6 +135,7 @@ def parse_cluster_shards(resp, **options):
"redis_connect_func",
"password",
"port",
"queue_class",
"retry",
"retry_on_timeout",
"socket_connect_timeout",
Expand Down
13 changes: 13 additions & 0 deletions tests/test_cluster.py
@@ -1,6 +1,7 @@
import binascii
import datetime
import warnings
from queue import LifoQueue, Queue
from time import sleep
from unittest.mock import DEFAULT, Mock, call, patch

Expand Down Expand Up @@ -2511,6 +2512,18 @@ def test_connection_pool_class(self, connection_pool_class):
node.redis_connection.connection_pool, connection_pool_class
)

@pytest.mark.parametrize("queue_class", [Queue, LifoQueue])
def test_allow_custom_queue_class(self, queue_class):
rc = get_mocked_redis_client(
url="redis://my@DNS.com:7000",
cluster_slots=default_cluster_slots,
connection_pool_class=BlockingConnectionPool,
queue_class=queue_class,
)

for node in rc.nodes_manager.nodes_cache.values():
assert node.redis_connection.connection_pool.queue_class == queue_class


@pytest.mark.onlycluster
class TestClusterPubSubObject:
Expand Down