增加支持docker部署
This commit is contained in:
@@ -2,12 +2,17 @@ import sqlite3
|
||||
import json
|
||||
from datetime import datetime
|
||||
from typing import Dict, List, Optional
|
||||
import os
|
||||
|
||||
class StockMonitorDatabase:
|
||||
"""股票监测数据库管理类"""
|
||||
|
||||
def __init__(self, db_path: str = "stock_monitor.db"):
|
||||
self.db_path = db_path
|
||||
# 确保数据库所在目录存在
|
||||
db_dir = os.path.dirname(self.db_path)
|
||||
if db_dir and not os.path.exists(db_dir):
|
||||
os.makedirs(db_dir, exist_ok=True)
|
||||
self.init_database()
|
||||
|
||||
def init_database(self):
|
||||
|
||||
Reference in New Issue
Block a user