Module: ObjectStorage

Defined in:
app/uploaders/object_storage.rb,
lib/object_storage/config.rb,
lib/object_storage/direct_upload.rb,
app/workers/object_storage/background_move_worker.rb,
app/workers/object_storage/migrate_uploads_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Defined Under Namespace

Modules: BackgroundMove, Concern, Extension, Store Classes: BackgroundMoveWorker, Config, DirectUpload, ExclusiveLeaseTaken, MigrateUploadsWorker

Constant Summary collapse

RemoteStoreError =
Class.new(StandardError)
UnknownStoreError =
Class.new(StandardError)
ObjectStorageUnavailable =
Class.new(StandardError)
TMP_UPLOAD_PATH =
'tmp/uploads'

Instance Method Summary collapse

Instance Method Details

#unsafe_use_fileObject


462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'app/uploaders/object_storage.rb', line 462

def unsafe_use_file
  if file_storage?
    return yield path
  end

  begin
    cache_stored_file!
    yield cache_path
  ensure
    FileUtils.rm_f(cache_path)
    cache_storage.delete_dir!(cache_path(nil))
  end
end