Method: Gitlab::RepositoryCacheAdapter#cache_method_output_as_redis_set

Defined in:
lib/gitlab/repository_cache_adapter.rb

#cache_method_output_as_redis_set(name, fallback: nil, &block) ⇒ Object

Caches and strongly memoizes the supplied block as a Redis Set. The result will be provided as a sorted array.

name - The name of the method to be cached. fallback - A value to fall back to if the repository does not exist, or

in case of a Git error. Defaults to nil.


185
186
187
188
189
# File 'lib/gitlab/repository_cache_adapter.rb', line 185

def cache_method_output_as_redis_set(name, fallback: nil, &block)
  memoize_method_output(name, fallback: fallback) do
    redis_set_cache.fetch(name, &block).sort
  end
end