Skip to content

Commit

Permalink
Wait for celery to return response to request to solve specification (#…
Browse files Browse the repository at this point in the history
…913)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
soapy1 and pre-commit-ci[bot] authored Oct 24, 2024
1 parent 6805e0c commit 3c76cff
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pydantic
import yaml

from celery.result import AsyncResult
from fastapi import APIRouter, Body, Depends, HTTPException, Query, Request
from fastapi.responses import PlainTextResponse, RedirectResponse

Expand Down Expand Up @@ -844,13 +845,13 @@ async def api_get_specification(

try:
task, solve_id = conda_store.register_solve(db, specification)
task.wait()
AsyncResult(task).wait()
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e.args[0]))

solve = api.get_solve(db, solve_id)

return {"solve": solve.packages}
return {"solve": solve.package_builds}


@router_api.post(
Expand Down

0 comments on commit 3c76cff

Please sign in to comment.