added bankwise file monitoring and calling the ach_api_txn_post procedure after each run
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user