Skip to content

Commit f86c0c7

Browse files
committed
Fix connections.py: allow to connect to Redis using a Unix socket URL without specifying the database number
1 parent bfa8e68 commit f86c0c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arq/connections.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ def from_dsn(cls, dsn: str) -> 'RedisSettings':
5555
if query_db:
5656
# e.g. redis://localhost:6379?db=1
5757
database = int(query_db[0])
58-
else:
58+
elif conf.scheme != 'unix':
5959
database = int(conf.path.lstrip('/')) if conf.path else 0
60+
else:
61+
database = 0
6062
return RedisSettings(
6163
host=conf.hostname or 'localhost',
6264
port=conf.port or 6379,

0 commit comments

Comments
 (0)