return last running task info

This commit is contained in:
liugq 2023-10-10 08:59:44 +08:00
parent 9f60c4685f
commit 12d4a8eef0
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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