diff --git a/plugin/task_manager/cluster_comparison/cluster_comparison.go b/plugin/task_manager/cluster_comparison/cluster_comparison.go index 9dcaf070..982419f2 100644 --- a/plugin/task_manager/cluster_comparison/cluster_comparison.go +++ b/plugin/task_manager/cluster_comparison/cluster_comparison.go @@ -56,9 +56,7 @@ func (p *processor) handleReadyMajorTask(taskItem *task.Task) error { return nil } taskItem.RetryTimes++ - if taskItem.StartTimeInMillis == 0 { - taskItem.StartTimeInMillis = time.Now().UnixMilli() - } + taskItem.StartTimeInMillis = time.Now().UnixMilli() taskItem.Status = task.StatusRunning taskItem.Metadata.Labels["total_diff_docs"] = 0 taskItem.Metadata.Labels["only_in_source"] = 0 diff --git a/plugin/task_manager/common_api.go b/plugin/task_manager/common_api.go index 6bed3af8..e828a4a5 100644 --- a/plugin/task_manager/common_api.go +++ b/plugin/task_manager/common_api.go @@ -160,7 +160,11 @@ func (h *APIHandler) populateMajorTaskInfo(taskID string, sourceM util.MapStr) { sourceM.Put("metadata.labels.source_total_docs", ts.SourceDocs) } case "cluster_comparison": - ts, _, err := h.getComparisonMajorTaskInfo(taskID) + targetTaskId := taskID + if repeatStatus.IsRepeat && repeatStatus.LastRunChildTaskID != "" { + targetTaskId = repeatStatus.LastRunChildTaskID + } + ts, _, err := h.getComparisonMajorTaskInfo(targetTaskId) if err != nil { log.Warnf("fetch progress info of task error: %v", err) return