Skip to content

Commit

Permalink
build: debug server api
Browse files Browse the repository at this point in the history
  • Loading branch information
okradze committed Nov 2, 2023
1 parent 59e3b67 commit 2700776
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions apps/worker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
CELERY_BEAT_SCHEDULE = {
"register-scheduled-run-tasks": {
"task": "register-scheduled-run-tasks",
"schedule": timedelta(minutes=2),
"schedule": timedelta(seconds=15),
},
"register-fine-tuning-tasks": {
"task": "register-fine-tuning-tasks",
"schedule": timedelta(minutes=5),
"schedule": timedelta(seconds=15),
},
}

Expand All @@ -41,8 +41,12 @@ def execute_scheduled_runs_task():
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
)

print(res.text)

schedules_with_configs = res.json()

print(schedules_with_configs)

for schedule in schedules_with_configs:
execute_single_schedule_task.apply_async(args=[schedule["schedule"]["id"]])

Expand Down Expand Up @@ -75,10 +79,13 @@ def register_fine_tunings_task():
f"{Config.SERVER_URL}/fine-tuning/pending",
headers={"Authorization": f"Bearer {Config.SERVER_AUTH_TOKEN}"},
)
fine_tunings = res.json()

for fine_tuning in fine_tunings:
check_single_fine_tuning_task.apply_async(args=[fine_tuning["id"]])
return res.text

# fine_tunings = res.json()

# for fine_tuning in fine_tunings:
# check_single_fine_tuning_task.apply_async(args=[fine_tuning["id"]])


@app.task(
Expand Down

0 comments on commit 2700776

Please sign in to comment.