changed some logging levels and replaced ach_api_log_temp with ach_api_log table
This commit is contained in:
@@ -21,18 +21,6 @@ class OracleConnector:
|
|||||||
"""Initialize connection pool."""
|
"""Initialize connection pool."""
|
||||||
self.pool = None
|
self.pool = None
|
||||||
self.config = get_config()
|
self.config = get_config()
|
||||||
self._initialize_client_mode()
|
|
||||||
|
|
||||||
def _initialize_client_mode(self):
|
|
||||||
"""
|
|
||||||
Initialize oracledb client mode.
|
|
||||||
oracledb uses Thin mode by default (no Oracle Instant Client needed).
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
# oracledb defaults to Thin mode - no initialization needed
|
|
||||||
logger.info("Using oracledb Thin mode (no Oracle Instant Client required)")
|
|
||||||
except Exception as e:
|
|
||||||
logger.warning(f"Oracle client initialization note: {e}")
|
|
||||||
|
|
||||||
def initialize_pool(self):
|
def initialize_pool(self):
|
||||||
"""Create connection pool."""
|
"""Create connection pool."""
|
||||||
@@ -53,7 +41,7 @@ class OracleConnector:
|
|||||||
increment=1,
|
increment=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f"Oracle connection pool initialized: min={self.config.db_pool_min}, max={self.config.db_pool_max}")
|
logger.debug(f"Oracle connection pool initialized: min={self.config.db_pool_min}, max={self.config.db_pool_max}")
|
||||||
return True
|
return True
|
||||||
except oracledb.DatabaseError as e:
|
except oracledb.DatabaseError as e:
|
||||||
logger.error(f"Failed to initialize connection pool: {e}", exc_info=True)
|
logger.error(f"Failed to initialize connection pool: {e}", exc_info=True)
|
||||||
@@ -96,7 +84,7 @@ class OracleConnector:
|
|||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
logger.info("Database connection test successful")
|
logger.debug("Database connection test successful")
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Database connection test failed: {e}")
|
logger.error(f"Database connection test failed: {e}")
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class Repository:
|
|||||||
|
|
||||||
# Execute batch insert
|
# Execute batch insert
|
||||||
insert_sql = """
|
insert_sql = """
|
||||||
INSERT INTO ach_api_log_temp (
|
INSERT INTO ach_api_log (
|
||||||
narration, status, bankcode, jrnl_id,
|
narration, status, bankcode, jrnl_id,
|
||||||
tran_date, cbs_acct, tran_amt, TXNIND
|
tran_date, cbs_acct, tran_amt, TXNIND
|
||||||
) VALUES (
|
) VALUES (
|
||||||
@@ -237,13 +237,13 @@ class Repository:
|
|||||||
try:
|
try:
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# Check if ach_api_log_temp table exists
|
# Check if ach_api_log table exists
|
||||||
try:
|
try:
|
||||||
cursor.execute("SELECT COUNT(*) FROM ach_api_log_temp WHERE ROWNUM = 1")
|
cursor.execute("SELECT COUNT(*) FROM ach_api_log WHERE ROWNUM = 1")
|
||||||
logger.info("✓ ach_api_log_temp table exists")
|
logger.info("✓ ach_api_log table exists")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"✗ ach_api_log_temp table not found: {e}")
|
logger.error(f"✗ ach_api_log table not found: {e}")
|
||||||
raise SystemExit("FATAL: ach_api_log_temp table must be created manually before running this application")
|
raise SystemExit("FATAL: ach_api_log table must be created manually before running this application")
|
||||||
|
|
||||||
# Check if ach_processed_files table exists
|
# Check if ach_processed_files table exists
|
||||||
try:
|
try:
|
||||||
|
|||||||
1
main.py
1
main.py
@@ -9,6 +9,7 @@ from logging_config import setup_logging, get_logger
|
|||||||
from scheduler import Scheduler
|
from scheduler import Scheduler
|
||||||
|
|
||||||
# Initialize logging
|
# Initialize logging
|
||||||
|
logging.getLogger("paramiko").setLevel(logging.WARNING)
|
||||||
logger = setup_logging(log_level=logging.INFO)
|
logger = setup_logging(log_level=logging.INFO)
|
||||||
app_logger = get_logger(__name__)
|
app_logger = get_logger(__name__)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user