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
Boxiang Sun
gitlab-ce
Commits
cb3a0e33
Commit
cb3a0e33
authored
Apr 03, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug; truncate did not reset size and tell
parent
9766af36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/gitlab/ci/trace/chunked_file/chunked_io.rb
lib/gitlab/ci/trace/chunked_file/chunked_io.rb
+3
-3
lib/gitlab/ci/trace/chunked_file/live_trace.rb
lib/gitlab/ci/trace/chunked_file/live_trace.rb
+2
-1
No files found.
lib/gitlab/ci/trace/chunked_file/chunked_io.rb
View file @
cb3a0e33
...
...
@@ -152,7 +152,7 @@ module Gitlab
end
def
get_chunk
return
''
unless
size
>
0
return
''
if
size
<=
0
||
eof?
unless
in_range?
chunk_store
.
open
(
job_id
,
chunk_index
,
params_for_store
)
do
|
store
|
...
...
@@ -233,8 +233,8 @@ module Gitlab
(
size
/
buffer_size
.
to_f
).
ceil
end
def
last_
range
((
size
/
buffer_size
)
*
buffer_size
..
size
)
def
last_
chunk?
((
size
/
buffer_size
)
*
buffer_size
..
size
)
.
include?
(
tell
)
end
def
chunk_store
...
...
lib/gitlab/ci/trace/chunked_file/live_trace.rb
View file @
cb3a0e33
...
...
@@ -25,6 +25,7 @@ module Gitlab
def
truncate
(
offset
)
if
offset
==
0
delete
@size
=
@tell
=
0
elsif
offset
==
size
# no-op
else
...
...
@@ -45,7 +46,7 @@ module Gitlab
end
def
chunk_store
if
last_
range
.
include?
(
tell
)
if
last_
chunk?
ChunkedFile
::
ChunkStore
::
Redis
else
ChunkedFile
::
ChunkStore
::
Database
...
...
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