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

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

module Gitlab
  module Patch
    module CommandLoader
      extend ActiveSupport::Concern

      class_methods do
        # Shuffle the node list to spread out initial connection creation amongst all nodes
        #
        # The input is a Redis::Cluster::Node instance which is an Enumerable.
        #  `super` receives an Array of Redis::Client instead of a Redis::Cluster::Node
        def load(nodes)
          super(nodes.to_a.shuffle)
        end
      end
    end
  end
end