fix gc job submit issue

fixes #12795
Return 409 on triggering a GC job when there is a job ongoing.

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
wang yan 2020-08-18 14:01:16 +08:00
parent da52e677e5
commit 44f7bf6739

View File

@ -261,7 +261,7 @@ func (aj *AJAPI) submit(ajr *models.AdminJobReq) {
if jb.UpdateTime.Add(2 * time.Hour).After(time.Now()) {
if isOnGoing(jb.Status) {
err := errors.Errorf("reject job submitting: job %s with ID %d is %s", jb.Name, jb.ID, jb.Status)
aj.SendInternalServerError(errors.Wrap(err, "submit : AJAPI"))
aj.SendConflictError(errors.Wrap(err, "submit : AJAPI"))
return
}