Skip to content
Snippets Groups Projects
Commit e1f28420 authored by Max Lou's avatar Max Lou
Browse files

Adding env vars

parent 77be971f
No related branches found
No related tags found
No related merge requests found
DYNACONF_SQLALCHEMY_DATABASE_URI=
DYNACONF_SECRET=
DYNACONF_CELERY_BROKER_URL =
DYNACONF_CELERY_RESULT_BACKEND =
DYNACONF_ANALYTICS_BACKEND_URL =
DYNACONF_RIGHTS_ENGINE_BACKEND_URL =
\ No newline at end of file
......@@ -6,14 +6,17 @@ from subprocess import PIPE, STDOUT, Popen
import git
import requests
from celery import shared_task
from dynaconf import settings
from scheduler.ext.database import db
from scheduler.models import Job
ANALYTICS_BACKEND = settings.get("ANALYTICS_BACKEND_URL", "")
RIGHTS_ENGINE_BACKEND = settings.get("RIGHTS_ENGINE_BACKEND_URL", "")
def append_job_log(result_token, job_id, job_output, succeeded=True):
# TODO read from config
url = f"http://127.0.0.1:5000/api/v1/jobs/{job_id}/log"
url = f"{ANALYTICS_BACKEND}/api/v1/jobs/{job_id}/log"
print(url)
response = requests.post(
url,
json={"result_token": result_token, "log": job_output, "succeeded": succeeded},
......@@ -24,8 +27,7 @@ def append_job_log(result_token, job_id, job_output, succeeded=True):
def run_results_retention(analytics_token):
# TODO read from config
url = f"http://127.0.0.1:8003/api/v1/provider/results-retention"
url = f"{RIGHTS_ENGINE_BACKEND}/api/v1/provider/results-retention"
response = requests.post(url, headers={"Authorization": f"Basic {analytics_token}"})
if not response.ok:
print(response.status_code)
......
......@@ -12,6 +12,8 @@ EXTENSIONS = [
]
CELERY_BROKER_URL = "redis://localhost:6379/0"
CELERY_RESULT_BACKEND = "redis://localhost:6379/1"
ANALYTICS_BACKEND_URL = "http://127.0.0.1:5000"
RIGHTS_ENGINE_BACKEND_URL = "http://127.0.0.1:8003"
[development]
EXTENSIONS = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment