diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-05 21:33:32 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-05 21:33:32 +0300 |
commit | 160b4827edad1984ddb4339622b93ace17870cb1 (patch) | |
tree | 2ceaf492f689cfa7a1e4fc39c4ff7685d14a3913 /lib | |
parent | 6b3585d8ea15a7ee1a5cd2f5799caace48ab0c32 (diff) | |
parent | 373f6a9bb20497eebe4cdf41be18eb2399424a59 (diff) |
Merge branch '44665-fix-db-trace-stream-by-raw-access' into 'master'
Fix `JobsController#raw` endpoint can not read traces in database
Closes #44665
See merge request gitlab-org/gitlab-ce!18101
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/trace/stream.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb index b3fe3ef1c4d..54894a46077 100644 --- a/lib/gitlab/ci/trace/stream.rb +++ b/lib/gitlab/ci/trace/stream.rb @@ -8,7 +8,7 @@ module Gitlab attr_reader :stream - delegate :close, :tell, :seek, :size, :path, :url, :truncate, to: :stream, allow_nil: true + delegate :close, :tell, :seek, :size, :url, :truncate, to: :stream, allow_nil: true delegate :valid?, to: :stream, as: :present?, allow_nil: true @@ -25,6 +25,10 @@ module Gitlab self.path.present? end + def path + self.stream.path if self.stream.respond_to?(:path) + end + def limit(last_bytes = LIMIT_SIZE) if last_bytes < size stream.seek(-last_bytes, IO::SEEK_END) |