Merge pull request '[migration] mark task as stopped if pipeline not found' (#83) from fix/migration into master
This commit is contained in:
commit
38d2a746f2
|
@ -212,6 +212,12 @@ func (p *processor) handlePendingStopPipelineTask(taskItem *task.Task) error {
|
||||||
|
|
||||||
err = instance.StopPipelineWithTimeout(taskItem.ID, time.Second)
|
err = instance.StopPipelineWithTimeout(taskItem.ID, time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if strings.Contains(err.Error(), "task not found") {
|
||||||
|
taskItem.Status = task.StatusStopped
|
||||||
|
p.saveTaskAndWriteLog(taskItem, nil, fmt.Sprintf("[%v] task [%s] not found on remote node, mark as stopped", taskItem.Metadata.Labels["pipeline_id"], taskItem.ID))
|
||||||
|
p.cleanGatewayPipeline(taskItem)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
log.Errorf("failed to stop pipeline, err: %v", err)
|
log.Errorf("failed to stop pipeline, err: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue