Skip to content

Commit

Permalink
fix: worker api url
Browse files Browse the repository at this point in the history
  • Loading branch information
okradze committed Jan 7, 2024
1 parent b439c6e commit b41d1e8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/worker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
def execute_scheduled_runs_task():
res = requests.get(
f"{Config.SERVER_URL}/schedule/due",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)

schedules_with_configs = res.json()
Expand All @@ -62,7 +62,7 @@ def execute_scheduled_runs_task():
def execute_single_schedule_task(schedule_id: str):
res = requests.post(
f"{Config.SERVER_URL}/schedule/{schedule_id}/run",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)
return res.json()

Expand All @@ -76,7 +76,7 @@ def execute_single_schedule_task(schedule_id: str):
def register_fine_tunings_task():
res = requests.get(
f"{Config.SERVER_URL}/fine-tuning/pending",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)

fine_tunings = res.json()
Expand All @@ -97,7 +97,7 @@ def register_fine_tunings_task():
def check_single_fine_tuning_task(fine_tuning_id: str):
res = requests.post(
f"{Config.SERVER_URL}/fine-tuning/{fine_tuning_id}/check",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)

return res.json()
Expand All @@ -112,7 +112,7 @@ def check_single_fine_tuning_task(fine_tuning_id: str):
def register_campaign_phone_call_tasks():
res = requests.get(
f"{Config.PR_DEV_SERVER_URL}/v1/campaign/due",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)

campaigns = res.json()
Expand All @@ -122,7 +122,7 @@ def register_campaign_phone_call_tasks():
for campaign in campaigns:
res = requests.post(
f"{Config.PR_DEV_SERVER_URL}/v1/campaign/{campaign['id']}/start",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)

contact_ids = res.json()
Expand All @@ -142,7 +142,7 @@ def register_campaign_phone_call_tasks():
def make_phone_call(campaign_id: str, contact_id: str):
res = requests.post(
f"{Config.PR_DEV_SERVER_URL}/call/campaign",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
data={
"campaign_id": campaign_id,
"contact_id": contact_id,
Expand All @@ -155,7 +155,7 @@ def make_phone_call(campaign_id: str, contact_id: str):
while True:
status_res = requests.get(
f"{Config.PR_DEV_SERVER_URL}/call/{call_id}",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
headers={"Authorization": Config.SERVER_AUTH_TOKEN},
)

status = status_res.json().get("status")
Expand Down

0 comments on commit b41d1e8

Please sign in to comment.