Method: ActiveStorage::Service::AzureStorageService#delete_prefixed

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

#delete_prefixed(prefix) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'activestorage/lib/active_storage/service/azure_storage_service.rb', line 67

def delete_prefixed(prefix)
  instrument :delete_prefixed, prefix: prefix do
    marker = nil

    loop do
      results = client.list_blobs(container, prefix: prefix, marker: marker)

      results.each do |blob|
        client.delete_blob(container, blob.name)
      end

      break unless marker = results.continuation_token.presence
    end
  end
end