added bankwise file monitoring and calling the ach_api_txn_post procedure after each run

This commit is contained in:
2026-02-05 11:58:59 +05:30
parent ca3095b8f5
commit 81ad34fd65
2 changed files with 49 additions and 8 deletions

View File

@@ -205,6 +205,29 @@ class Repository:
cursor.close()
conn.close()
def call_ach_api_txn_post(self) -> bool:
"""
Call the ach_api_txn_post procedure to process inserted transactions.
Should be called once per processing cycle after all files are inserted.
Returns:
True if procedure executed successfully, False otherwise
"""
conn = self.connector.get_connection()
try:
cursor = conn.cursor()
logger.info("Calling ach_api_txn_post procedure to process all inserted transactions...")
cursor.execute("CALL ach_api_txn_post()")
conn.commit()
logger.info("ach_api_txn_post procedure executed successfully")
return True
except Exception as e:
logger.error(f"Error calling ach_api_txn_post procedure: {e}", exc_info=True)
return False
finally:
cursor.close()
conn.close()
def verify_tables_exist(self):
"""
Verify that required database tables exist.