auto-sync: 2026-04-28 23:39:46
This commit is contained in:
@@ -77,6 +77,22 @@ class ResultStorage:
|
||||
|
||||
return BacktestResult(**data)
|
||||
|
||||
def find_task(self, task_id: str) -> Optional[BacktestTaskWithId]:
|
||||
"""在所有状态目录中查找任务"""
|
||||
for status_dir in ["running", "failed", "completed", "pending"]:
|
||||
task = self.load_task(task_id, status_dir)
|
||||
if task:
|
||||
return task
|
||||
return None
|
||||
|
||||
def find_result(self, task_id: str) -> Optional[BacktestResult]:
|
||||
"""在所有状态目录中查找结果"""
|
||||
for status_dir in ["failed", "completed", "running", "pending"]:
|
||||
result = self.load_result(task_id, status_dir)
|
||||
if result:
|
||||
return result
|
||||
return None
|
||||
|
||||
def get_task_path(self, task_id: str, status: str, filename: str) -> str:
|
||||
"""获取任务文件路径"""
|
||||
return os.path.join(self._task_dir(task_id, status), filename)
|
||||
|
||||
Reference in New Issue
Block a user