[plugins][migration] status_log -> logging (#40)

[plugins][migration] status_log -> logging

Co-authored-by: Kassian Sun <kassiansun@outlook.com>
This commit is contained in:
sunjiacheng 2023-03-28 20:12:23 +08:00 committed by medcl
parent df6b4a1737
commit 633d0333f2
1 changed files with 156 additions and 157 deletions

View File

@ -7,6 +7,11 @@ package migration
import (
"errors"
"fmt"
"math"
"strings"
"syscall"
"time"
log "github.com/cihub/seelog"
"infini.sh/console/model"
"infini.sh/framework/core/config"
@ -19,10 +24,6 @@ import (
task2 "infini.sh/framework/core/task"
"infini.sh/framework/core/util"
"infini.sh/framework/modules/elastic/common"
"math"
"strings"
"syscall"
"time"
)
type DispatcherProcessor struct {
@ -409,7 +410,7 @@ func (p *DispatcherProcessor) handlePendingStopSubTask(taskItem *task2.Task) err
"size": len(taskIDs),
"sort": []util.MapStr{
{
"payload.pipeline.status_log.steps": util.MapStr{
"payload.pipeline.logging.steps": util.MapStr{
"order": "desc",
},
},
@ -432,7 +433,7 @@ func (p *DispatcherProcessor) handlePendingStopSubTask(taskItem *task2.Task) err
}
MainLoop:
for _, hit := range searchRes.Hits.Hits {
status, _ := util.MapStr(hit.Source).GetValue("payload.pipeline.status_log.status")
status, _ := util.MapStr(hit.Source).GetValue("payload.pipeline.logging.status")
if status != "STOPPED" {
//call instance api to stop scroll/bulk_indexing pipeline task
if instID, ok := taskItem.Metadata.Labels["execution_instance_id"].(string); ok {
@ -1228,7 +1229,6 @@ func (p *DispatcherProcessor) getTaskCompleteState(subTask *task2.Task) (*TaskCo
},
},
},
},
}
esClient := elastic.GetClient(p.config.Elasticsearch)
@ -1354,7 +1354,6 @@ func (p *DispatcherProcessor) getMajorTaskState(majorTask *task2.Task) (taskStat
},
},
},
},
}
esClient := elastic.GetClient(p.config.Elasticsearch)