debian-mirror-gitlab/lib/gitlab/redis/db_load_balancing.rb

24 lines
532 B
Ruby
Raw Normal View History

2023-04-23 21:23:45 +05:30
# frozen_string_literal: true
module Gitlab
module Redis
class DbLoadBalancing < ::Gitlab::Redis::Wrapper
class << self
# The data we store on DbLoadBalancing used to be stored on SharedState.
def config_fallback
SharedState
end
private
def redis
primary_store = ::Redis.new(params)
secondary_store = ::Redis.new(config_fallback.params)
MultiStore.new(primary_store, secondary_store, store_name)
end
end
end
end
end