2017-08-17 22:00:37 +05:30
|
|
|
class LfsObjectUploader < GitlabUploader
|
2018-03-17 18:26:18 +05:30
|
|
|
extend Workhorse::UploadPath
|
2015-11-26 14:37:03 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
# LfsObject are in `tmp/upload` instead of `tmp/uploads`
|
|
|
|
def self.workhorse_upload_path
|
|
|
|
File.join(root, 'tmp/upload')
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
storage_options Gitlab.config.lfs
|
2015-11-26 14:37:03 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def filename
|
|
|
|
model.oid[4..-1]
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def store_dir
|
|
|
|
dynamic_segment
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def dynamic_segment
|
|
|
|
File.join(model.oid[0, 2], model.oid[2, 2])
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
|
|
|
end
|