Skip to content

Commit

Permalink
feat: Allow additional redis args
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Apr 16, 2024
1 parent 9d7944b commit cab6f1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arq/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ async def create_pool(
job_deserializer: Optional[Deserializer] = None,
default_queue_name: str = default_queue_name,
expires_extra_ms: int = expires_extra_ms,
**additional_redis_args: Any,
) -> ArqRedis:
"""
Create a new redis pool, retrying up to ``conn_retries`` times if the connection fails.
Expand All @@ -243,7 +244,7 @@ def pool_factory(*args: Any, **kwargs: Any) -> ArqRedis:
*args,
sentinels=settings.host,
ssl=settings.ssl,
**kwargs,
**{**kwargs, **additional_redis_args},
)
redis = client.master_for(settings.sentinel_master, redis_class=ArqRedis)
return cast(ArqRedis, redis)
Expand All @@ -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,
**additional_redis_args,
)

while True:
Expand Down

0 comments on commit cab6f1e

Please sign in to comment.