Update job status when failed to submit it

Set the status of replication job to "error" when the submitting to jobservice fails
This commit is contained in:
Wenkai Yin 2018-08-01 10:35:01 +08:00
parent d557ec89d7
commit 4ecbf3c0f5

View File

@ -119,6 +119,9 @@ func (d *DefaultReplicator) Replicate(replication *Replication) error {
uuid, err := d.client.SubmitJob(job)
if err != nil {
if er := dao.UpdateRepJobStatus(id, common_models.JobError); er != nil {
log.Errorf("failed to update the status of job %d: %s", id, er)
}
return err
}