Depends only works with fastApi methods, so don't use Depends for other methods
This commit is contained in:
parent
ab7e6728b5
commit
b83f5fd606
@ -22,7 +22,7 @@ class DeploymentService:
|
||||
async def init_deployment(
|
||||
self,
|
||||
request: InitDeploymentRequest,
|
||||
dao: DeploymentDao = Depends(get_deployment_dao)
|
||||
dao: DeploymentDao = get_deployment_dao()
|
||||
) -> Deployment:
|
||||
"""
|
||||
"""
|
||||
@ -117,7 +117,7 @@ class DeploymentService:
|
||||
async def _get_code_depot_by_product_id(
|
||||
self,
|
||||
product_id: str,
|
||||
code_depot_dao: CodeDepotDao = Depends(get_code_depot_dao)
|
||||
code_depot_dao: CodeDepotDao = get_code_depot_dao()
|
||||
) -> CodeDepotDoc:
|
||||
"""
|
||||
Retrieve code depot by product id
|
||||
@ -147,16 +147,18 @@ class DeploymentService:
|
||||
) -> bool:
|
||||
"""
|
||||
Start the deployment
|
||||
Return true atm, modify calling reconsile service later
|
||||
"""
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.post(
|
||||
f"{reconsile_base_url}/api/devops/reconcile",
|
||||
json=deployment.model_dump()
|
||||
)
|
||||
if response.status_code != 200:
|
||||
raise HTTPException(status_code=response.status_code, detail=response.text)
|
||||
# async with httpx.AsyncClient() as client:
|
||||
# response = await client.post(
|
||||
# f"{reconsile_base_url}/api/devops/reconcile",
|
||||
# json=deployment.model_dump()
|
||||
# )
|
||||
# if response.status_code != 200:
|
||||
# raise HTTPException(status_code=response.status_code, detail=response.text)
|
||||
return True
|
||||
|
||||
# TODO: dummy test code, remove later
|
||||
async def create_dummy_code_depot(
|
||||
self,
|
||||
code_depot_dao: CodeDepotDao = Depends(get_code_depot_dao)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user