Skip to content

Commit

Permalink
Allow executing several profiles at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 15, 2025
1 parent 61a3c5e commit ee58eb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ def view_process(process_id: str) -> model.Process:
@app.post('/processes/{process_id}/execution', status_code=201)
def process_execution(process_id: str, data: model.ValidationExecute, req: Request, resp: Response,
background_tasks: BackgroundTasks) -> model.StatusInfo:
profile = app.profile_loader.profiles.get(process_id)

if not profile:
profiles = [app.profile_loader.profiles.get(pid) for pid in process_id.split(',')]

if not all(profiles):
raise HTTPException(
status_code=404,
detail=model.Exception(
Expand All @@ -134,7 +135,7 @@ def process_execution(process_id: str, data: model.ValidationExecute, req: Reque

parameters = {k: v for k, v in data.inputs.model_dump().items() if k != 'cityFiles'}
job = job_executor.create_job(city_files=data.inputs.cityFiles,
profiles=[profile],
profiles=profiles,
parameters=parameters,
profile_loader=app.profile_loader)
job_id = job.job_id
Expand Down

0 comments on commit ee58eb1

Please sign in to comment.