Method: ActiveStorage::Service::GCSService#delete_prefixed

Defined in:
activestorage/lib/active_storage/service/gcs_service.rb

#delete_prefixed(prefix) ⇒ Object



74
75
76
77
78
79
80
81
82
# File 'activestorage/lib/active_storage/service/gcs_service.rb', line 74

def delete_prefixed(prefix)
  instrument :delete_prefixed, prefix: prefix do
    bucket.files(prefix: prefix).all do |file|
      file.delete
    rescue Google::Cloud::NotFoundError
      # Ignore concurrently-deleted files
    end
  end
end