summaryrefslogtreecommitdiff
path: root/app/uploaders/lfs_object_uploader.rb
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2018-02-05 15:16:41 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2018-02-05 15:16:41 -0600
commit46ae03628de47d1bef2683a3a5fe4963b3df7d52 (patch)
treeaca69b4acab10d5699a6315556de7e7530e65dbe /app/uploaders/lfs_object_uploader.rb
parente6016d0bc2b640801914369e25e1a3639d3e50eb (diff)
parent2150ed4094ddb67d7b403cd56360700c80e7d928 (diff)
downloadgitlab-ce-46ae03628de47d1bef2683a3a5fe4963b3df7d52.tar.gz
Merge branch 'master' into jivl-update-katex
Diffstat (limited to 'app/uploaders/lfs_object_uploader.rb')
-rw-r--r--app/uploaders/lfs_object_uploader.rb21
1 files changed, 13 insertions, 8 deletions
diff --git a/app/uploaders/lfs_object_uploader.rb b/app/uploaders/lfs_object_uploader.rb
index d11ebf0f9ca..e04c97ce179 100644
--- a/app/uploaders/lfs_object_uploader.rb
+++ b/app/uploaders/lfs_object_uploader.rb
@@ -1,19 +1,24 @@
class LfsObjectUploader < GitlabUploader
- storage :file
+ extend Workhorse::UploadPath
- def store_dir
- "#{Gitlab.config.lfs.storage_path}/#{model.oid[0, 2]}/#{model.oid[2, 2]}"
+ # LfsObject are in `tmp/upload` instead of `tmp/uploads`
+ def self.workhorse_upload_path
+ File.join(root, 'tmp/upload')
end
- def cache_dir
- "#{Gitlab.config.lfs.storage_path}/tmp/cache"
- end
+ storage_options Gitlab.config.lfs
def filename
model.oid[4..-1]
end
- def work_dir
- File.join(Gitlab.config.lfs.storage_path, 'tmp', 'work')
+ def store_dir
+ dynamic_segment
+ end
+
+ private
+
+ def dynamic_segment
+ File.join(model.oid[0, 2], model.oid[2, 2])
end
end