From d9a3c52f69ee6ccbf106331a8aec490260567e62 Mon Sep 17 00:00:00 2001 From: Cizz22 Date: Mon, 23 Feb 2026 13:38:21 +0700 Subject: [PATCH] feat: Add AEROS session timeout and streamline AEROS post request JSON handling and error checking. --- src/aeros_project/service.py | 7 +++---- src/aeros_utils.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aeros_project/service.py b/src/aeros_project/service.py index ebfa6a5..3d338e6 100644 --- a/src/aeros_project/service.py +++ b/src/aeros_project/service.py @@ -175,21 +175,20 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr await db_session.commit() - aro_json = json.dumps(aro_path) + # aro_json = json.dumps(aro_path) # Update path to AEROS APP # Example BODy "C/dsad/dsad.aro" try: response = await aeros_post( "/api/Project/ImportAROFile", - json_data=aro_json, + json=aro_path, headers={"Content-Type": "application/json"}, ) - # response.raise_for_status() + response.raise_for_status() response_json = response.json() - raise Exception(response_json) except Exception as e: raise HTTPException( diff --git a/src/aeros_utils.py b/src/aeros_utils.py index 95acfc7..ebc866f 100644 --- a/src/aeros_utils.py +++ b/src/aeros_utils.py @@ -17,6 +17,7 @@ def get_aeros_session(base_url): api_base=base_url, license_id=AEROS_LICENSE_ID, license_secret=AEROS_LICENSE_SECRET, + timeout=1000 ) return _aeros_session