Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-08 03:32:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-08 03:32:37 +0300
commit469a50879c1085ec77c95d650b7f135fee2c9e13 (patch)
tree0d639a63294b5abdb4e4a7bf1ed5a497d5e6869f /app/controllers/projects
parentaa5ca44f172f02f04cca448b1f9c17d6d933de40 (diff)
Add latest changes from gitlab-org/gitlab@13-7-stable-ee
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/jobs_controller.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index 900ebc61856..d2703f5cc38 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -49,21 +49,25 @@ class Projects::JobsController < Projects::ApplicationController
# rubocop: enable CodeReuse/ActiveRecord
def trace
- @build.trace.read do |stream|
- respond_to do |format|
- format.json do
- @build.trace.being_watched!
-
- build_trace = Ci::BuildTrace.new(
- build: @build,
- stream: stream,
- state: params[:state])
-
- render json: BuildTraceSerializer
- .new(project: @project, current_user: @current_user)
- .represent(build_trace)
+ @build.trace.being_watched! if @build.running?
+
+ if @build.has_trace?
+ @build.trace.read do |stream|
+ respond_to do |format|
+ format.json do
+ build_trace = Ci::BuildTrace.new(
+ build: @build,
+ stream: stream,
+ state: params[:state])
+
+ render json: BuildTraceSerializer
+ .new(project: @project, current_user: @current_user)
+ .represent(build_trace)
+ end
end
end
+ else
+ head :no_content
end
end