fix(chalice): parse whole Redis URL in healthcheck
This commit is contained in:
parent
c3e8da8880
commit
1624e99809
1 changed files with 2 additions and 3 deletions
|
|
@ -123,8 +123,7 @@ def __check_redis(*_):
|
|||
return fail_response
|
||||
|
||||
try:
|
||||
u = urlparse(config("REDIS_STRING"))
|
||||
r = redis.Redis(host=u.hostname, port=u.port, socket_timeout=2)
|
||||
r = redis.from_url(config("REDIS_STRING"))
|
||||
r.ping()
|
||||
except Exception as e:
|
||||
print("!! Issue getting redis-health response")
|
||||
|
|
@ -162,7 +161,7 @@ def __check_SSL(*_):
|
|||
def __get_sessions_stats(*_):
|
||||
with pg_client.PostgresClient() as cur:
|
||||
constraints = ["projects.deleted_at IS NULL"]
|
||||
query = cur.mogrify(f"""SELECT COALESCE(SUM(sessions_count),0) AS s_c,
|
||||
query = cur.mogrify(f"""SELECT COALESCE(SUM(sessions_count),0) AS s_c,
|
||||
COALESCE(SUM(events_count),0) AS e_c
|
||||
FROM public.projects_stats
|
||||
INNER JOIN public.projects USING(project_id)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue