summaryrefslogtreecommitdiff
path: root/app/uploaders/lfs_object_uploader.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-07 21:27:04 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2018-02-28 20:29:37 +0100
commitbc76062774f01208403685965f4d780da4e03ebb (patch)
treee9e21e57b8783f25475648889372f4c3aed4eb3b /app/uploaders/lfs_object_uploader.rb
parent5a69b51bc870f5b42ee3406ba77de02f44ef8d32 (diff)
downloadgitlab-ce-bc76062774f01208403685965f4d780da4e03ebb.tar.gz
Merge branch 'jej/lfs-object-storage' into 'master'
Can migrate LFS objects to S3 style object storage Closes #2841 See merge request !2760
Diffstat (limited to 'app/uploaders/lfs_object_uploader.rb')
-rw-r--r--app/uploaders/lfs_object_uploader.rb21
1 files changed, 10 insertions, 11 deletions
diff --git a/app/uploaders/lfs_object_uploader.rb b/app/uploaders/lfs_object_uploader.rb
index d11ebf0f9ca..8a5f599c1d3 100644
--- a/app/uploaders/lfs_object_uploader.rb
+++ b/app/uploaders/lfs_object_uploader.rb
@@ -1,19 +1,18 @@
-class LfsObjectUploader < GitlabUploader
- storage :file
+class LfsObjectUploader < ObjectStoreUploader
+ storage_options Gitlab.config.lfs
+ after :store, :schedule_migration_to_object_storage
- def store_dir
- "#{Gitlab.config.lfs.storage_path}/#{model.oid[0, 2]}/#{model.oid[2, 2]}"
- end
-
- def cache_dir
- "#{Gitlab.config.lfs.storage_path}/tmp/cache"
+ def self.local_store_path
+ Gitlab.config.lfs.storage_path
end
def filename
- model.oid[4..-1]
+ subject.oid[4..-1]
end
- def work_dir
- File.join(Gitlab.config.lfs.storage_path, 'tmp', 'work')
+ private
+
+ def default_path
+ "#{subject.oid[0, 2]}/#{subject.oid[2, 2]}"
end
end