gitlab-org--gitlab-foss/app/uploaders/lfs_object_uploader.rb
Stan Hu 8a417f5ae8 Set artifact working directory to be in the destination store to prevent unnecessary I/O
Similar to #33218, build artifacts were being uploaded into a CarrierWave
temporary directory in the Rails root directory before moved to their
final destination, which could cause a copy across filesystems. This
merge request refactors the work in !11866 so that any uploader can
just override `work_dir` to change the default implementation.

Closes #33274
2017-06-06 09:51:28 -07:00

19 lines
361 B
Ruby

class LfsObjectUploader < GitlabUploader
storage :file
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"
end
def filename
model.oid[4..-1]
end
def work_dir
File.join(Gitlab.config.lfs.storage_path, 'tmp', 'work')
end
end