成功的时候才更新状态

This commit is contained in:
huang 2017-02-28 09:55:42 +08:00
parent 1f3a13b933
commit ada7962231
1 changed files with 6 additions and 2 deletions

View File

@ -853,7 +853,9 @@ class ProjectsController < ApplicationController
params = {jobName: jobName, pipeLine: pipeLine}
res = uri_exec uri, params
training_project_notice res
@project.update_attribute(:training_status, 1)
if res['code'] == 0
@project.update_attribute(:training_status, 1)
end
end
def training_project_update
@ -863,7 +865,9 @@ class ProjectsController < ApplicationController
params = {jobName: jobName, pipeLine: pipeLine}
res = uri_exec uri, params
training_project_notice res
@project.update_attribute(:training_status, 1)
if res['code'] == 0
@project.update_attribute(:training_status, 1)
end
end
def training_project_notice res