优化结构

This commit is contained in:
Yvan
2026-08-24 13:25:16 +08:00
parent 7a9a738c6a
commit 0b6b8ddf1a
72 changed files with 2475 additions and 1443 deletions
-5
View File
@@ -23,9 +23,6 @@ type TaskExecutor struct {
}
func NewTaskExecutorWithRegistry(tasks *taskbiz.TaskUsecase, methods taskbiz.TaskMethodRegistry) *TaskExecutor {
if methods == nil {
methods = taskbiz.DefaultTaskMethodRegistry()
}
return &TaskExecutor{tasks: tasks, methods: methods}
}
@@ -139,8 +136,6 @@ func (e *TaskExecutor) runMethod(ctx context.Context, task *taskbiz.TimedTask) e
var ok bool
if e.methods != nil {
method, ok = e.methods.Lookup(task.MethodName)
} else {
method, ok = taskbiz.TaskMethodByName(task.MethodName)
}
if !ok {
return fmt.Errorf("方法 %s 未注册(需通过 platform/task.Registry 注册)", task.MethodName)