gitlab-org--gitlab-foss/app/uploaders/lfs_object_uploader.rb
Sean McGivern a7dae52e9d Merge branch '4163-move-uploads-to-object-storage' into 'master'
Move uploads to object storage

Closes #4163

See merge request gitlab-org/gitlab-ee!3867
2018-02-28 20:58:15 +01:00

25 lines
453 B
Ruby

class LfsObjectUploader < GitlabUploader
extend Workhorse::UploadPath
include ObjectStorage::Concern
# LfsObject are in `tmp/upload` instead of `tmp/uploads`
def self.workhorse_upload_path
File.join(root, 'tmp/upload')
end
storage_options Gitlab.config.lfs
def filename
model.oid[4..-1]
end
def store_dir
dynamic_segment
end
private
def dynamic_segment
File.join(model.oid[0, 2], model.oid[2, 2])
end
end