diff options
Diffstat (limited to 'app/uploaders/object_storage.rb')
-rw-r--r-- | app/uploaders/object_storage.rb | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/app/uploaders/object_storage.rb b/app/uploaders/object_storage.rb index 063aca7937c..e74998ce4a8 100644 --- a/app/uploaders/object_storage.rb +++ b/app/uploaders/object_storage.rb @@ -67,16 +67,6 @@ module ObjectStorage super end - def schedule_background_upload(*args) - return unless schedule_background_upload? - return unless upload - - ObjectStorage::BackgroundMoveWorker.perform_async(self.class.name, - upload.class.to_s, - mounted_as, - upload.id) - end - def exclusive_lease_key # For FileUploaders, model may have many uploaders. In that case # we want to use exclusive key per upload, not per model to allow @@ -99,40 +89,6 @@ module ObjectStorage end end - # Add support for automatic background uploading after the file is stored. - # - module BackgroundMove - extend ActiveSupport::Concern - - def background_upload(mount_points = []) - return unless mount_points.any? - - run_after_commit do - mount_points.each { |mount| send(mount).schedule_background_upload } # rubocop:disable GitlabSecurity/PublicSend - end - end - - def changed_mounts - self.class.uploaders.select do |mount, uploader_class| - mounted_as = uploader_class.serialization_column(self.class, mount) - uploader = send(:"#{mounted_as}") # rubocop:disable GitlabSecurity/PublicSend - - next unless uploader - next unless uploader.exists? - next unless send(:"saved_change_to_#{mounted_as}?") # rubocop:disable GitlabSecurity/PublicSend - - mount - end.keys - end - - included do - include AfterCommitQueue - after_save do - background_upload(changed_mounts) - end - end - end - module Concern extend ActiveSupport::Concern @@ -155,10 +111,6 @@ module ObjectStorage object_store_options&.direct_upload end - def background_upload_enabled? - object_store_options.background_upload - end - def proxy_download_enabled? object_store_options.proxy_download end @@ -311,15 +263,6 @@ module ObjectStorage end end - def schedule_background_upload(*args) - return unless schedule_background_upload? - - ObjectStorage::BackgroundMoveWorker.perform_async(self.class.name, - model.class.name, - mounted_as, - model.id) - end - def fog_directory self.class.remote_store_path end @@ -405,12 +348,6 @@ module ObjectStorage private - def schedule_background_upload? - self.class.object_store_enabled? && - self.class.background_upload_enabled? && - self.file_storage? - end - def cache_remote_file!(remote_object_id, original_filename) file_path = File.join(TMP_UPLOAD_PATH, remote_object_id) file_path = Pathname.new(file_path).cleanpath.to_s |