add Unix socket support for redis-host=
This commit is contained in:
parent
72844929ea
commit
41a5a559e8
|
@ -1,11 +1,4 @@
|
|||
from redis import Redis
|
||||
from redis import from_url
|
||||
from srht.config import cfg
|
||||
from urllib.parse import urlparse
|
||||
|
||||
url = cfg("sr.ht", "redis-host", "redis://localhost")
|
||||
url = urlparse(url)
|
||||
|
||||
redis = Redis(host=url.hostname,
|
||||
port=(url.port or 6379),
|
||||
password=url.password,
|
||||
db=int(url.path[1:]) if url.path else 0)
|
||||
redis = from_url(cfg("sr.ht", "redis-host", "redis://localhost"))
|
||||
|
|
Loading…
Reference in New Issue