Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
a84d0204
Commit
a84d0204
authored
Apr 19, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Build#append_trace method usage when trace file doesn't exists yet
parent
4019b0d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
lib/ci/api/builds.rb
lib/ci/api/builds.rb
+3
-2
No files found.
app/models/ci/build.rb
View file @
a84d0204
...
...
@@ -253,7 +253,7 @@ module Ci
def
append_trace
(
trace_part
,
offset
)
recreate_trace_dir
File
.
truncate
(
path_to_trace
,
offset
)
File
.
truncate
(
path_to_trace
,
offset
)
if
File
.
exist?
(
path_to_trace
)
File
.
open
(
path_to_trace
,
'a'
)
do
|
f
|
f
.
write
(
trace_part
)
end
...
...
lib/ci/api/builds.rb
View file @
a84d0204
...
...
@@ -71,8 +71,9 @@ module Ci
content_range
=
request
.
headers
[
'Content-Range'
]
content_range
=
content_range
.
split
(
'-'
)
unless
build
.
trace_length
==
content_range
[
0
].
to_i
return
error!
(
'416 Range Not Satisfiable'
,
416
,
{
'Range'
=>
"0-
#{
build
.
trace_length
}
"
})
current_length
=
build
.
trace_length
unless
current_length
==
content_range
[
0
].
to_i
return
error!
(
'416 Range Not Satisfiable'
,
416
,
{
'Range'
=>
"0-
#{
current_length
}
"
})
end
build
.
append_trace
(
request
.
body
.
read
,
content_range
[
0
].
to_i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment