From 60fb5e3e558c1378d3cb9d95d8960679b3555757 Mon Sep 17 00:00:00 2001 From: sophia Date: Wed, 23 Oct 2024 16:04:37 -0700 Subject: [PATCH 1/2] Wait for celery to solve specification --- .../conda_store_server/_internal/server/views/api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conda-store-server/conda_store_server/_internal/server/views/api.py b/conda-store-server/conda_store_server/_internal/server/views/api.py index 496e46f67..c5af098be 100644 --- a/conda-store-server/conda_store_server/_internal/server/views/api.py +++ b/conda-store-server/conda_store_server/_internal/server/views/api.py @@ -9,6 +9,8 @@ import pydantic import yaml +from celery.result import AsyncResult + from fastapi import APIRouter, Body, Depends, HTTPException, Query, Request from fastapi.responses import PlainTextResponse, RedirectResponse @@ -844,13 +846,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( From c0d7a3ae2c044e6b0978174f4a0bcfadd7cd46d9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 23:20:34 +0000 Subject: [PATCH 2/2] [pre-commit.ci] Apply automatic pre-commit fixes --- .../conda_store_server/_internal/server/views/api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conda-store-server/conda_store_server/_internal/server/views/api.py b/conda-store-server/conda_store_server/_internal/server/views/api.py index c5af098be..45e3ed993 100644 --- a/conda-store-server/conda_store_server/_internal/server/views/api.py +++ b/conda-store-server/conda_store_server/_internal/server/views/api.py @@ -10,7 +10,6 @@ import yaml from celery.result import AsyncResult - from fastapi import APIRouter, Body, Depends, HTTPException, Query, Request from fastapi.responses import PlainTextResponse, RedirectResponse