feat: Add AEROS session timeout and streamline AEROS post request JSON handling and error checking.

main
Cizz22 2 weeks ago
parent 34e66858c4
commit d9a3c52f69

@ -175,21 +175,20 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
await db_session.commit() await db_session.commit()
aro_json = json.dumps(aro_path) # aro_json = json.dumps(aro_path)
# Update path to AEROS APP # Update path to AEROS APP
# Example BODy "C/dsad/dsad.aro" # Example BODy "C/dsad/dsad.aro"
try: try:
response = await aeros_post( response = await aeros_post(
"/api/Project/ImportAROFile", "/api/Project/ImportAROFile",
json_data=aro_json, json=aro_path,
headers={"Content-Type": "application/json"}, headers={"Content-Type": "application/json"},
) )
# response.raise_for_status() response.raise_for_status()
response_json = response.json() response_json = response.json()
raise Exception(response_json)
except Exception as e: except Exception as e:
raise HTTPException( raise HTTPException(

@ -17,6 +17,7 @@ def get_aeros_session(base_url):
api_base=base_url, api_base=base_url,
license_id=AEROS_LICENSE_ID, license_id=AEROS_LICENSE_ID,
license_secret=AEROS_LICENSE_SECRET, license_secret=AEROS_LICENSE_SECRET,
timeout=1000
) )
return _aeros_session return _aeros_session

Loading…
Cancel
Save