debian-mirror-gitlab/app/uploaders/lfs_object_uploader.rb

25 lines
383 B
Ruby
Raw Normal View History

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
2018-12-05 23:21:45 +05:30
alias_method :upload, :model
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