From 4ecbf3c0f594ed849543cda33f45c63015b14d23 Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Wed, 1 Aug 2018 10:35:01 +0800 Subject: [PATCH] Update job status when failed to submit it Set the status of replication job to "error" when the submitting to jobservice fails --- src/replication/replicator/replicator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/replication/replicator/replicator.go b/src/replication/replicator/replicator.go index d7d47a0ff..70835ff12 100644 --- a/src/replication/replicator/replicator.go +++ b/src/replication/replicator/replicator.go @@ -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 }