diff --git a/apps/worker/main.py b/apps/worker/main.py index b58e247d6..6c9f47ca3 100644 --- a/apps/worker/main.py +++ b/apps/worker/main.py @@ -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() @@ -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() @@ -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() @@ -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() @@ -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() @@ -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() @@ -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, @@ -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")