You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
863 B
37 lines
863 B
"""
|
|
数据缓冲平台 - 配置
|
|
"""
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# 项目根目录
|
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
|
|
# 数据库路径
|
|
DB_PATH = Path(os.getenv(
|
|
"BUFFER_DB_PATH",
|
|
str(Path(__file__).resolve().parent.parent / "data" / "buffer.db")
|
|
))
|
|
|
|
# 原始采集脚本路径
|
|
COLLECTOR_SCRIPT = os.getenv(
|
|
"COLLECTOR_SCRIPT",
|
|
str(BASE_DIR / "market_data_colector_platform" / "futures_data_collector.py")
|
|
)
|
|
|
|
# FastAPI 服务配置
|
|
HOST = os.getenv("BUFFER_HOST", "0.0.0.0")
|
|
PORT = int(os.getenv("BUFFER_PORT", "8600"))
|
|
|
|
# 数据缓存
|
|
CACHE_TTL_SECONDS = int(os.getenv("CACHE_TTL", "300")) # 默认5分钟过期
|
|
|
|
# 并发采集
|
|
MAX_WORKERS = int(os.getenv("MAX_WORKERS", "2"))
|
|
|
|
# 日志
|
|
LOG_LEVEL = os.getenv("BUFFER_LOG_LEVEL", "INFO")
|
|
|
|
# 调度器
|
|
SCHEDULER_MAX_INSTANCES = 1 # 同一任务不允许重叠执行
|