2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
class LfsObjectUploader < GitlabUploader
|
2018-03-17 18:26:18 +05:30
|
|
|
extend Workhorse::UploadPath
|
2018-05-09 12:01:36 +05:30
|
|
|
include ObjectStorage::Concern
|
2015-11-26 14:37:03 +05:30
|
|
|
|
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
|