[migration] tune cleaning gateway error logs

This commit is contained in:
Kassian Sun 2023-04-22 15:26:23 +08:00
parent da908cebfb
commit 20498e2e76
2 changed files with 4 additions and 4 deletions

View File

@ -1333,12 +1333,11 @@ func (p *DispatcherProcessor) refreshInstanceJobsFromES() error {
func (p *DispatcherProcessor) cleanGatewayQueue(taskItem *task2.Task) {
var err error
instance := model.Instance{}
instanceID := taskItem.Metadata.Labels["execution_instance_id"]
if instanceID == "" {
instance.ID, _ = util.ExtractString(taskItem.Metadata.Labels["execution_instance_id"])
if instance.ID == "" {
log.Debugf("task [%s] not scheduled yet, skip cleaning queue", taskItem.ID)
return
}
instance.ID, _ = util.ExtractString(instanceID)
_, err = orm.Get(&instance)
if err != nil {
log.Errorf("failed to get instance, err: %v", err)

View File

@ -218,8 +218,9 @@ func (p *processor) cleanGatewayPipeline(taskItem *task.Task) (instance model.In
return
}
err = instance.DeletePipeline(taskItem.ID)
if err != nil {
if err != nil && !strings.Contains(err.Error(), "task not found") {
log.Errorf("delete pipeline failed, err: %v", err)
return
}
return instance, nil