解析device和task的配置全部用内置方法处理

This commit is contained in:
2025-09-27 00:58:22 +08:00
parent 29fa23ba36
commit aed665b6b0
8 changed files with 46 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
package task
import (
"encoding/json"
"errors"
"sync"
"time"
@@ -305,7 +304,7 @@ func (s *Scheduler) analysisPlan(claimedLog *models.TaskExecutionLog) error {
var params struct {
PlanID uint `json:"plan_id"`
}
if err := json.Unmarshal(claimedLog.Task.Parameters, &params); err != nil {
if err := claimedLog.Task.ParseParameters(&params); err != nil {
s.logger.Errorf("解析任务参数中的计划ID失败日志ID: %d, 错误: %v", claimedLog.ID, err)
return err
}