[add]: Timeout

This commit is contained in:
VivianDee
2026-04-10 10:39:49 +01:00
parent 60b928221a
commit a3fcba00b4
3 changed files with 9 additions and 7 deletions
+5 -4
View File
@@ -11,6 +11,7 @@ class SimbrellaIntegration:
HEALTH_ENDPOINT = settings.SIMBRELLA_HEALTH
AUTH_ENDPOINT = settings.BANK_CALL_AUTH_ENDPOINT
SIMBRELLA_VERIFY_BALANCE_ENDPOINT = settings.SIMBRELLA_VERIFY_BALANCE_ENDPOINT
TIMEOUT = settings.TIMEOUT
_access_token = None # cache token in memory
_token_expiry = 0
@@ -33,7 +34,7 @@ class SimbrellaIntegration:
try:
logger.info(f"Requesting Bank token from {url}")
response = httpx.post(url, json=payload, headers=headers, timeout=10.0)
response = httpx.post(url, json=payload, headers=headers, timeout=SimbrellaIntegration.TIMEOUT)
response.raise_for_status()
data = response.json()
@@ -86,7 +87,7 @@ class SimbrellaIntegration:
}
response = httpx.post(url, json=payload, headers=headers, timeout=10.0)
response = httpx.post(url, json=payload, headers=headers, timeout=SimbrellaIntegration.TIMEOUT)
logger.info(f"This is Response: {str(response)}", exc_info=True)
@@ -122,7 +123,7 @@ class SimbrellaIntegration:
url,
json=payload,
headers=headers,
timeout=10.0,
timeout=SimbrellaIntegration.TIMEOUT,
)
logger.info(
@@ -164,7 +165,7 @@ class SimbrellaIntegration:
"Authorization": f"Bearer {access_token}"
}
response = httpx.get(url, headers=headers, timeout=10.0)
response = httpx.get(url, headers=headers, timeout=SimbrellaIntegration.TIMEOUT)
logger.info(f"Bank Health Check Response: {response.text}")
return response
except Exception as e: