|
|
|
|
@ -35,6 +35,20 @@ from .utils import calculate_eaf, stream_large_array
|
|
|
|
|
# client = httpx.AsyncClient(timeout=300.0) # Managed in src.aeros_utils
|
|
|
|
|
active_simulations = {}
|
|
|
|
|
|
|
|
|
|
async def call_ahm_callback_service(simulation_id: str, job_id: str):
|
|
|
|
|
from src.config import AHM_BASE_URL, AHM_SIMULATION_CALLBACK_URL
|
|
|
|
|
url = f"{AHM_BASE_URL}{AHM_SIMULATION_CALLBACK_URL}"
|
|
|
|
|
payload = {
|
|
|
|
|
"simulation_id": simulation_id,
|
|
|
|
|
"job_id": job_id,
|
|
|
|
|
"status": "completed"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async with httpx.AsyncClient() as client:
|
|
|
|
|
resp = await client.post(url, json=payload, timeout=10.0)
|
|
|
|
|
resp.raise_for_status()
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get Data Service
|
|
|
|
|
async def get_all(common, current_user):
|
|
|
|
|
@ -439,8 +453,6 @@ async def execute_simulation(*, db_session: DbSession, simulation_id: Optional[U
|
|
|
|
|
)
|
|
|
|
|
file_obj = response.raw
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await save_simulation_result(
|
|
|
|
|
db_session=db_session, simulation_id=simulation.id, schematic_name=sim_data["SchematicName"], eq_update=eq_update, file_path=file_obj
|
|
|
|
|
)
|
|
|
|
|
|