Welcome to mirror list, hosted at ThFree Co, Russian Federation.

repository_cache.rb « redis « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c7bc8c41d5fa0f1dde928cb5877954cb5786daf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Gitlab
  module Redis
    class RepositoryCache < ::Gitlab::Redis::Wrapper
      class << self
        # The data we store on RepositoryCache used to be stored on Cache.
        def config_fallback
          Cache
        end

        def cache_store
          @cache_store ||= ActiveSupport::Cache::RedisCacheStore.new(
            redis: pool,
            compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
            namespace: Cache::CACHE_NAMESPACE,
            expires_in: Cache.default_ttl_seconds,
            error_handler: ::Gitlab::Redis::ERROR_HANDLER
          )
        end
      end
    end
  end
end