Commit b07b8a5f authored by Lin Jen-Shin's avatar Lin Jen-Shin

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
parent ef33b7f3
...@@ -25,13 +25,11 @@ module Gitlab ...@@ -25,13 +25,11 @@ module Gitlab
end end
def limit(last_bytes = LIMIT_SIZE) def limit(last_bytes = LIMIT_SIZE)
stream_size = size if last_bytes < size
if stream_size < last_bytes
last_bytes = stream_size
end
stream.seek(-last_bytes, IO::SEEK_END) stream.seek(-last_bytes, IO::SEEK_END)
stream.readline stream.readline
end end
end
def append(data, offset) def append(data, offset)
stream.truncate(offset) stream.truncate(offset)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment