Class: Uploads::Fog

Inherits:
Base
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/models/uploads/fog.rb

Constant Summary

Constants inherited from Base

Base::BATCH_SIZE

Instance Attribute Summary

Attributes inherited from Base

#logger

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods inherited from Base

#delete_keys_async, #initialize

Constructor Details

This class inherits a constructor from Uploads::Base

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)

7
8
9
# File 'app/models/uploads/fog.rb', line 7

def available?
  object_store.enabled
end

#delete_keys(keys) ⇒ Object


17
18
19
20
21
# File 'app/models/uploads/fog.rb', line 17

def delete_keys(keys)
  keys.each do |key|
    connection.delete_object(bucket_name, key)
  end
end

#keys(relation) ⇒ Object


11
12
13
14
15
# File 'app/models/uploads/fog.rb', line 11

def keys(relation)
  return [] unless available?

  relation.pluck(:path)
end