Skip to content

Commit

Permalink
fix(backend): run xform update in background task
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Mar 1, 2024
1 parent 8a7bdb6 commit ef6a0fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ async def download_form(

@router.post("/update-form")
async def update_project_form(
# background_tasks: BackgroundTasks,
background_tasks: BackgroundTasks,
category: str = Form(...),
upload: Optional[UploadFile] = File(None),
db: Session = Depends(database.get_db),
Expand Down Expand Up @@ -955,7 +955,9 @@ async def update_project_form(
# Get task id list
task_list = await tasks_crud.get_task_id_list(db, project.id)
# Update ODK Central form data
await central_crud.update_odk_xforms(
# FIXME runs in background but status is not tracked
background_tasks.add_task(
central_crud.update_odk_xforms,
task_list,
project.odkid,
new_xform_data,
Expand Down

0 comments on commit ef6a0fb

Please sign in to comment.