|
|
|
|
@ -59,13 +59,10 @@ async def get_target_reliability(
|
|
|
|
|
|
|
|
|
|
if duration != 17520:
|
|
|
|
|
if not simulation_id:
|
|
|
|
|
simulation = await run_rbd_simulation(
|
|
|
|
|
sim_hours=duration,
|
|
|
|
|
token=token
|
|
|
|
|
raise HTTPException(
|
|
|
|
|
status_code=status.HTTP_425_TOO_EARLY, # or 409 Conflict
|
|
|
|
|
detail="Simulation still running. Please wait.",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
simulation_id = simulation.get("data")
|
|
|
|
|
await wait_for_workflow(simulation_id=simulation_id)
|
|
|
|
|
else:
|
|
|
|
|
temporal_client = await Client.connect(TEMPORAL_URL)
|
|
|
|
|
handle = temporal_client.get_workflow_handle(f"simulation-{simulation_id}")
|
|
|
|
|
|