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:
authorLin Jen-Shin <godfat@godfat.org>2017-04-13 17:07:37 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-04-13 17:07:37 +0300
commitb07b8a5f3ed8383b7b3b37fc3f99c086ddc42e20 (patch)
tree4c65dfceb6f46be8e8c3b8a6863814480a7371ac
parentef33b7f388beb3be9063e2d23ee74dcb19aec217 (diff)
Don't seek at all if the log is small anyway
then it's fine to skip the first line because it won't be very noticeable
-rw-r--r--lib/gitlab/ci/trace/stream.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb
index 5e634bcac71..3b335cdfd01 100644
--- a/lib/gitlab/ci/trace/stream.rb
+++ b/lib/gitlab/ci/trace/stream.rb
@@ -25,12 +25,10 @@ module Gitlab
end
def limit(last_bytes = LIMIT_SIZE)
- stream_size = size
- if stream_size < last_bytes
- last_bytes = stream_size
+ if last_bytes < size
+ stream.seek(-last_bytes, IO::SEEK_END)
+ stream.readline
end
- stream.seek(-last_bytes, IO::SEEK_END)
- stream.readline
end
def append(data, offset)