diff --git a/api/.chalice/config.json b/api/.chalice/config.json index 060607b45..42382be52 100644 --- a/api/.chalice/config.json +++ b/api/.chalice/config.json @@ -33,6 +33,7 @@ "sourcemaps_reader": "http://utilities.app.svc.cluster.local:9000/sourcemaps", "sourcemaps_bucket": "sourcemaps", "js_cache_bucket": "sessions-assets", + "peers": "http://utilities.app.svc.cluster.local:9000/peers", "async_Token": "", "EMAIL_HOST": "", "EMAIL_PORT": "587", diff --git a/api/chalicelib/core/assist.py b/api/chalicelib/core/assist.py index 9f26ea07e..485d1d624 100644 --- a/api/chalicelib/core/assist.py +++ b/api/chalicelib/core/assist.py @@ -1,6 +1,7 @@ from chalicelib.utils import pg_client, helper from chalicelib.core import projects import requests +from chalicelib.utils.helper import environ SESSION_PROJECTION_COLS = """s.project_id, s.session_id::text AS session_id, @@ -20,7 +21,7 @@ SESSION_PROJECTION_COLS = """s.project_id, def get_live_sessions(project_id): project_key = projects.get_project_key(project_id) - connected_peers = requests.get(f"http://127.0.0.1:9000/peers/{project_key}") + connected_peers = requests.get(environ["peers"] + f"/{project_key}") if connected_peers.status_code != 200: print("!! issue with the peer-server") print(connected_peers.text) diff --git a/scripts/helm/app/chalice.yaml b/scripts/helm/app/chalice.yaml index e0c409669..328ad17e3 100644 --- a/scripts/helm/app/chalice.yaml +++ b/scripts/helm/app/chalice.yaml @@ -62,6 +62,7 @@ env: S3_KEY: minios3AccessKeyS3cr3t S3_SECRET: m1n10s3CretK3yPassw0rd sourcemaps_reader: 'http://utilities.app.svc.cluster.local:9000/sourcemaps' + peers: 'http://utilities.app.svc.cluster.local:9000/peers' # Enable logging for python app # Ref: https://stackoverflow.com/questions/43969743/logs-in-kubernetes-pod-not-showing-up PYTHONUNBUFFERED: '0'