summaryrefslogtreecommitdiff
path: root/lib/api/runner.rb
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-05-29 14:21:28 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-05-29 14:21:28 +0000
commitc1717225c2157d00658333376f1362d4084999cb (patch)
treead65fe748d57a7344b13a9e90816b33529e24556 /lib/api/runner.rb
parent88f28e0ec8259082a16636bbf2247e14eee927a0 (diff)
parent4c74936f4567ba142bcd9ca31c8f5f10c8aa52fa (diff)
downloadgitlab-ce-c1717225c2157d00658333376f1362d4084999cb.tar.gz
Merge branch 'master' into 'bootstrap-fixes-from-ee'bootstrap-fixes-from-ee
# Conflicts: # app/assets/javascripts/jobs/components/sidebar_details_block.vue
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r--lib/api/runner.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index a7f1cb1131f..5b7ae89440c 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -123,6 +123,7 @@ module API
end
put '/:id' do
job = authenticate_job!
+ forbidden!('Job is not running') unless job.running?
job.trace.set(params[:trace]) if params[:trace]
@@ -131,9 +132,9 @@ module API
case params[:state].to_s
when 'success'
- job.success
+ job.success!
when 'failed'
- job.drop(params[:failure_reason] || :unknown_failure)
+ job.drop!(params[:failure_reason] || :unknown_failure)
end
end