From e28442e3ffb8b6196e4b7f9e275db715eafd9e60 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 12 Dec 2024 23:51:58 +0100 Subject: [PATCH] Allow `protocol` to be set in RedisSettings This requires at least redis 5.0.0 version --- arq/connections.py | 2 ++ pyproject.toml | 2 +- requirements/pyproject.txt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arq/connections.py b/arq/connections.py index c1058890..78606278 100644 --- a/arq/connections.py +++ b/arq/connections.py @@ -45,6 +45,7 @@ class RedisSettings: conn_retries: int = 5 conn_retry_delay: int = 1 max_connections: Optional[int] = None + protocol: Optional[int] = None sentinel: bool = False sentinel_master: str = 'mymaster' @@ -266,6 +267,7 @@ def pool_factory(*args: Any, **kwargs: Any) -> ArqRedis: retry_on_timeout=settings.retry_on_timeout, retry_on_error=settings.retry_on_error, max_connections=settings.max_connections, + protocol=settings.protocol, ) while True: diff --git a/pyproject.toml b/pyproject.toml index cc7b10fc..7d97a2ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ classifiers = [ ] requires-python = '>=3.8' dependencies = [ - 'redis[hiredis]>=4.2.0,<6', + 'redis[hiredis]>=5.0.0,<6', 'click>=8.0', ] optional-dependencies = {watch = ['watchfiles>=0.16'] } diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt index 041adfac..d15436a7 100644 --- a/requirements/pyproject.txt +++ b/requirements/pyproject.txt @@ -12,7 +12,7 @@ hiredis==2.3.2 # via redis idna==3.7 # via anyio -redis==4.6.0 +redis==5.0.8 # via arq (pyproject.toml) sniffio==1.3.1 # via anyio