[migration] info api returns repeat in labels
This commit is contained in:
parent
f7e3f74f07
commit
4d60f7c174
|
@ -129,6 +129,7 @@ func (h *APIHandler) getDataMigrationTaskInfo(w http.ResponseWriter, req *http.R
|
||||||
completedIndices++
|
completedIndices++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg := global.MustLookup("cluster_migration_config")
|
cfg := global.MustLookup("cluster_migration_config")
|
||||||
if migrationConfig, ok := cfg.(*DispatcherConfig); ok {
|
if migrationConfig, ok := cfg.(*DispatcherConfig); ok {
|
||||||
if obj.Metadata.Labels == nil {
|
if obj.Metadata.Labels == nil {
|
||||||
|
@ -139,6 +140,13 @@ func (h *APIHandler) getDataMigrationTaskInfo(w http.ResponseWriter, req *http.R
|
||||||
"index_name": migrationConfig.LogIndexName,
|
"index_name": migrationConfig.LogIndexName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, repeatStatus, err := h.calcRepeatingStatus(&obj)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("failed to calc repeat info, err: %v", err)
|
||||||
|
}
|
||||||
|
obj.Metadata.Labels["repeat"] = repeatStatus
|
||||||
|
|
||||||
obj.ConfigString = util.MustToJSON(taskConfig)
|
obj.ConfigString = util.MustToJSON(taskConfig)
|
||||||
obj.Metadata.Labels["completed_indices"] = completedIndices
|
obj.Metadata.Labels["completed_indices"] = completedIndices
|
||||||
h.WriteJSON(w, obj, http.StatusOK)
|
h.WriteJSON(w, obj, http.StatusOK)
|
||||||
|
|
|
@ -97,6 +97,13 @@ func (h *APIHandler) getDataComparisonTaskInfo(w http.ResponseWriter, req *http.
|
||||||
"index_name": migrationConfig.LogIndexName,
|
"index_name": migrationConfig.LogIndexName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, repeatStatus, err := h.calcRepeatingStatus(&obj)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("failed to calc repeat info, err: %v", err)
|
||||||
|
}
|
||||||
|
obj.Metadata.Labels["repeat"] = repeatStatus
|
||||||
|
|
||||||
obj.ConfigString = util.MustToJSON(taskConfig)
|
obj.ConfigString = util.MustToJSON(taskConfig)
|
||||||
obj.Metadata.Labels["completed_indices"] = completedIndices
|
obj.Metadata.Labels["completed_indices"] = completedIndices
|
||||||
h.WriteJSON(w, obj, http.StatusOK)
|
h.WriteJSON(w, obj, http.StatusOK)
|
||||||
|
|
Loading…
Reference in New Issue