diff --git a/pkg/cloudcommon/db/taskman/coordinator.go b/pkg/cloudcommon/db/taskman/coordinator.go index 3c4094f9ef7..39fe44c5a5b 100644 --- a/pkg/cloudcommon/db/taskman/coordinator.go +++ b/pkg/cloudcommon/db/taskman/coordinator.go @@ -77,13 +77,13 @@ func registerTaskAndWorkerMan(task interface{}, workerMan interface{}) { taskType := reflect.Indirect(reflect.ValueOf(task)).Type() taskTable[taskName] = taskType // log.Infof("Task %s registerd", taskName) - if workerMan != nil { + if workerMan != nil && !gotypes.IsNil(workerMan) { taskWorkerMap[taskName] = workerMan } } func RegisterTask(task interface{}) { - RegisterTaskAndWorker(task, nil) + registerTaskAndWorkerMan(task, nil) } func isTaskExist(taskName string) bool {