Skip to content

Commit

Permalink
Allow protocol to be set in RedisSettings
Browse files Browse the repository at this point in the history
This requires at least redis 5.0.0 version
  • Loading branch information
drizzt committed Dec 12, 2024
1 parent 2f752e2 commit e28442e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arq/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'] }
Expand Down
2 changes: 1 addition & 1 deletion requirements/pyproject.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e28442e

Please sign in to comment.