./data 폴더를 모니터랑 하고, 새 파일이 생기면 일치하는 파일 형식인지 찾은 후 데이터를 파싱해서 DB에 저장

This commit is contained in:
2025-07-28 16:17:24 +09:00
parent 1e275d2ac7
commit 29319cb12c
4 changed files with 321 additions and 244 deletions

View File

@ -18,7 +18,12 @@ db_cfg = config['database']
db_url = f"mysql+pymysql://{db_cfg['user']}:{db_cfg['password']}@{db_cfg['host']}/{db_cfg['name']}?charset=utf8mb4"
# MySQL 연결이 끊겼을 때 자동 재시도 옵션 포함
engine = create_engine(db_url, pool_pre_ping=True)
engine = create_engine(
db_url,
pool_pre_ping=True,
pool_recycle=3600, # 3600초 = 1시간
)
Session = sessionmaker(bind=engine)
def get_engine():