|
|
|
|
@ -64,6 +64,28 @@ async def get_target_reliability(
|
|
|
|
|
token=token
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
workflow_id = f"simulation-{simulation_id}"
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
try:
|
|
|
|
|
handle = temporal_client.get_workflow_handle(workflow_id=workflow_id)
|
|
|
|
|
desc = await handle.describe()
|
|
|
|
|
status = desc.status.name
|
|
|
|
|
|
|
|
|
|
if status not in ["RUNNING", "CONTINUED_AS_NEW"]:
|
|
|
|
|
print(f"Workflow {workflow_id} finished with status: {status}")
|
|
|
|
|
return status
|
|
|
|
|
|
|
|
|
|
print(f"Workflow {workflow_id} still {status}, checking again in {interval} seconds...")
|
|
|
|
|
|
|
|
|
|
except WorkflowNotFoundError:
|
|
|
|
|
print(f"Workflow {workflow_id} not found, treating as done.")
|
|
|
|
|
return "NOT_FOUND"
|
|
|
|
|
|
|
|
|
|
await asyncio.sleep(interval)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results = await get_simulation_results(
|
|
|
|
|
simulation_id=simulation_id,
|
|
|
|
|
token=token
|
|
|
|
|
|