We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af59c56 commit eaadf0dCopy full SHA for eaadf0d
1 file changed
cassandra/policies.py
@@ -150,12 +150,11 @@ class RoundRobinPolicy(LoadBalancingPolicy):
150
This load balancing policy is used by default.
151
"""
152
_live_hosts = frozenset(())
153
+ _position = 0
154
155
def populate(self, cluster, hosts):
156
self._live_hosts = frozenset(hosts)
- if len(hosts) <= 1:
157
- self._position = 0
158
- else:
+ if len(hosts) > 1:
159
self._position = randint(0, len(hosts) - 1)
160
161
def distance(self, host):
0 commit comments