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
This commit is contained in:
parent
ef33b7f388
commit
b07b8a5f3e
|
@ -25,12 +25,10 @@ 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
|
stream.seek(-last_bytes, IO::SEEK_END)
|
||||||
last_bytes = stream_size
|
stream.readline
|
||||||
end
|
end
|
||||||
stream.seek(-last_bytes, IO::SEEK_END)
|
|
||||||
stream.readline
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def append(data, offset)
|
def append(data, offset)
|
||||||
|
|
Loading…
Reference in New Issue