build: updated config for redis and wait_for_db command
This commit is contained in:
parent
db10c884e8
commit
4414a71331
7 changed files with 40 additions and 21 deletions
|
|
@ -6,17 +6,7 @@ from urllib.parse import urlparse
|
|||
|
||||
def redis_instance():
|
||||
if settings.REDIS_URL:
|
||||
tls_url = os.environ.get("REDIS_TLS_URL", False)
|
||||
url = urlparse(settings.REDIS_URL)
|
||||
if tls_url:
|
||||
url = urlparse(tls_url)
|
||||
ri = redis.Redis(
|
||||
host=url.hostname,
|
||||
port=url.port,
|
||||
password=url.password,
|
||||
ssl=True,
|
||||
ssl_cert_reqs=None,
|
||||
)
|
||||
ri = redis.from_url(settings.REDIS_URL, db=0)
|
||||
else:
|
||||
ri = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue