33 lines
746 B
Python
Executable File
33 lines
746 B
Python
Executable File
"""
|
|
自动化回测服务 - 配置
|
|
"""
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""回测服务配置"""
|
|
# 服务监听地址
|
|
host: str = "0.0.0.0"
|
|
port: int = 8088
|
|
|
|
# 最大并发回测数(根据CPU核数调整,NAS赛扬建议2)
|
|
max_workers: int = 2
|
|
|
|
# 回测任务存储根目录
|
|
base_dir: str = "/app/backtest_jobs"
|
|
|
|
# CORS 配置 - 开发环境允许所有来源
|
|
cors_allow_all: bool = True
|
|
|
|
# 调试模式
|
|
debug: bool = True
|
|
|
|
# 允许策略代码中导入模块
|
|
allow_imports: bool = True
|
|
|
|
# 最大回测时间限制(秒),防止无限循环
|
|
max_execution_time: int = 3600 # 1小时
|
|
|
|
|
|
settings = Settings()
|