This commit is contained in:
Yun
2025-08-27 14:21:20 +08:00
parent ddea445188
commit d39a8b14ee
+2 -2
View File
@@ -48,7 +48,7 @@ type Callback interface {
// @param data interface{} 任务数据 // @param data interface{} 任务数据
// @return WorkerCode 任务执行结果 // @return WorkerCode 任务执行结果
// @return time.Duration 任务执行时间间隔 // @return time.Duration 任务执行时间间隔
Worker(ctx context.Context, taskType string, taskId string, attachData interface{}) *OnceWorkerResp Worker(ctx context.Context, taskType OnceTaskType, taskId string, attachData interface{}) *OnceWorkerResp
} }
// var wo *Once = nil // var wo *Once = nil
@@ -243,7 +243,7 @@ func (l *Once) doTask(ctx context.Context, key string) {
ed := extendData{} ed := extendData{}
json.Unmarshal([]byte(str), &ed) json.Unmarshal([]byte(str), &ed)
resp := l.worker.Worker(ctx, s[0], s[1], ed.Data) resp := l.worker.Worker(ctx, OnceTaskType(s[0]), s[1], ed.Data)
if resp == nil { if resp == nil {
return return
} }