mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
eead64ba49
* dev: migration squash * dev: migrations squashed for apis and webhooks * dev: packages updated and move dj-database-url for local settings * dev: update package changes
22 lines
475 B
Python
22 lines
475 B
Python
import os
|
|
import redis
|
|
from django.conf import settings
|
|
from urllib.parse import urlparse
|
|
|
|
|
|
def redis_instance():
|
|
# connect to redis
|
|
if settings.REDIS_SSL:
|
|
url = urlparse(settings.REDIS_URL)
|
|
ri = redis.Redis(
|
|
host=url.hostname,
|
|
port=url.port,
|
|
password=url.password,
|
|
ssl=True,
|
|
ssl_cert_reqs=None,
|
|
)
|
|
else:
|
|
ri = redis.Redis.from_url(settings.REDIS_URL, db=0)
|
|
|
|
return ri
|