mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-20 14:11:11 +00:00

- Offloads uploading to GitLab Workhorse - Use /authorize request for fast uploading - Added backup recipes for artifacts - Support download acceleration using X-Sendfile
17 lines
301 B
Ruby
17 lines
301 B
Ruby
class FileStreamer #:nodoc:
|
|
attr_reader :to_path
|
|
|
|
def initialize(path)
|
|
@to_path = path
|
|
end
|
|
|
|
# Stream the file's contents if Rack::Sendfile isn't present.
|
|
def each
|
|
File.open(to_path, 'rb') do |file|
|
|
while chunk = file.read(16384)
|
|
yield chunk
|
|
end
|
|
end
|
|
end
|
|
end
|