Compare commits

..

2 Commits

Author SHA1 Message Date
VivianDee a3fcba00b4 [add]: Timeout 2026-04-10 10:39:49 +01:00
VivianDee 60b928221a Update 284be77cb54e_.py 2026-03-12 11:04:27 +01:00
3 changed files with 16 additions and 18 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ class EventServiceIntegration:
logger.info(f"Health Check URL: {url}")
try:
response = httpx.get(url, timeout=EventServiceIntegration.TIMEOUT)
response = httpx.get(url, timeout=5.0)
logger.info(f"Health Check Response: {response.text}")
return response
except Exception as e:
+14 -16
View File
@@ -62,26 +62,24 @@ class RepaymentService(BaseService):
if response.status_code != 200:
return ResponseHelper.error(result_description="Balance Check failed")
try:
response = response.json()
except Exception as e:
logger.error(f"Balance Check failed: Invalid JSON response - {str(e)}")
return ResponseHelper.error(result_description="Balance Check failed")
response = response.json()
logger.info(f"This is Response (Balance Check): {str(response)}", exc_info=True)
verify_account_balance_response = response.get('isSufficient', None) if response else None
if verify_account_balance_response is None:
return ResponseHelper.error(result_description="Balance Check failed")
if verify_account_balance_response in [False, "false"]:
logger.error("Balance Check failed: Insufficient Account Balance")
return ResponseHelper.error(result_description="Insufficient Account Balance")
if not response or response['responseCode'] != '00':
if response:
logger.error(f"{response['responseMessage']}")
return ResponseHelper.error(result_description=f"Balance Check failed")
verify_account_balance_response = response['isSufficient']
if not verify_account_balance_response or verify_account_balance_response in [False, "false"]:
logger.error(f"Balance Check failed: Insufficient Account Balance")
return ResponseHelper.error(result_description=f"Insufficient Account Balance")
# Save the repayment details
repayment = Repayment.create_repayment(
+1 -1
View File
@@ -21,7 +21,7 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"loan_repayment_schedules",
sa.Column("last_penal_date", sa.Float(), nullable=True),
sa.Column("last_penal_date", sa.DateTime(), nullable=True),
)
### end Alembic commands ###