diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-06-07 17:27:26 +0200 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-06-07 18:45:48 +0200 |
commit | a6a900256e194c28d8342db9c2d67df784877c14 (patch) | |
tree | fabd5896948584c4c787aca84e59af166b1e13ec /lib/api/runner.rb | |
parent | 6fafc63117a9382ee088e364e83431ebd1b63a4a (diff) | |
download | gitlab-ce-a6a900256e194c28d8342db9c2d67df784877c14.tar.gz |
Change update entrypoint instead of adding new keep-alive one
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r-- | lib/api/runner.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb index ac62b83ba4a..dc102259ca8 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -125,7 +125,7 @@ module API end put '/:id' do job = authenticate_job! - forbidden!('Job is not running') unless job.running? + job_forbidden!(job, 'Job is not running') unless job.running? job.trace.set(params[:trace]) if params[:trace] @@ -133,6 +133,8 @@ module API project: job.project.full_path) case params[:state].to_s + when 'running' + job.touch if job.needs_touch? when 'success' job.success! when 'failed' @@ -140,22 +142,6 @@ module API end end - desc 'Marks job as live' do - http_codes [[200, 'Request accepted']] - end - params do - requires :id, type: Integer, desc: %q(Job's ID) - optional :token, type: String, desc: %q(Job's authentication token) - end - post '/:id/keep-alive' do - job = authenticate_job! - - job.touch if job.running? && job.needs_touch? - - status 200 - header 'Job-Status', job.status - end - desc 'Appends a patch to the job trace' do http_codes [[202, 'Trace was patched'], [400, 'Missing Content-Range header'], @@ -168,7 +154,7 @@ module API end patch '/:id/trace' do job = authenticate_job! - forbidden!('Job is not running') unless job.running? + job_forbidden!(job, 'Job is not running') unless job.running? error!('400 Missing header Content-Range', 400) unless request.headers.key?('Content-Range') content_range = request.headers['Content-Range'] |