summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /app/uploaders
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/gitlab_uploader.rb8
-rw-r--r--app/uploaders/metric_image_uploader.rb4
2 files changed, 12 insertions, 0 deletions
diff --git a/app/uploaders/gitlab_uploader.rb b/app/uploaders/gitlab_uploader.rb
index 9758d3c87aa..abe06bd97e1 100644
--- a/app/uploaders/gitlab_uploader.rb
+++ b/app/uploaders/gitlab_uploader.rb
@@ -31,6 +31,14 @@ class GitlabUploader < CarrierWave::Uploader::Base
def absolute_path(upload_record)
File.join(root, upload_record.path)
end
+
+ def version(*args, **kwargs, &block)
+ # CarrierWave uploaded file "versions" are not tracked in the uploads
+ # table. Because of this they won't get replicated to Geo secondaries.
+ # If we ever want to use versions, we need to fix that first. Also see
+ # https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/1757.
+ raise "using CarrierWave alternate file version is not supported"
+ end
end
storage_options Gitlab.config.uploads
diff --git a/app/uploaders/metric_image_uploader.rb b/app/uploaders/metric_image_uploader.rb
index 0826bb251e4..d7d70518565 100644
--- a/app/uploaders/metric_image_uploader.rb
+++ b/app/uploaders/metric_image_uploader.rb
@@ -6,6 +6,10 @@ class MetricImageUploader < GitlabUploader # rubocop:disable Gitlab/NamespacedCl
prepend ObjectStorage::Extension::RecordsUploads
include UploaderHelper
+ def self.workhorse_local_upload_path
+ File.join(options.storage_path, 'uploads', TMP_UPLOAD_PATH)
+ end
+
private
def dynamic_segment