fix: 任务处理返回信息和错误error对象

This commit is contained in:
TsMask committed 2023-10-21 16:11:53 +08:00
1 parent 2c262e1e7d
commit bdc6fdaa89
5 files changed
+26 -16

No files matched your search

+3 -2
View File
@@ -20,7 +20,7 @@ type FooProcessor struct {
count int
}
func (s *FooProcessor) Execute(data any) any {
func (s *FooProcessor) Execute(data any) (any, error) {
logger.Infof("执行 %d 次,上次进度: %d ", s.count, s.progress)
s.count++
@@ -43,10 +43,11 @@ func (s *FooProcessor) Execute(data any) any {
}
// 返回结果,用于记录执行结果
return map[string]any{
result := map[string]any{
"repeat": options.Repeat,
"jobName": sysJob.JobName,
"invokeTarget": sysJob.InvokeTarget,
"targetParams": sysJob.TargetParams,
}
return result, nil
}