Skip to content

Commit b3c7328

Browse files
author
Robert Gartman
committed
Automate _cluster_setup
1 parent 4a89685 commit b3c7328

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mem3_helper.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ def diff(first, second):
149149
second = set(second)
150150
return [item for item in first if item not in second]
151151

152+
153+
@backoff.on_exception(
154+
backoff.expo,
155+
requests.exceptions.ConnectionError,
156+
max_tries=10
157+
)
152158
# Check if the _membership API on all (known) CouchDB nodes have the same values.
153159
# Returns true if sam. False in any other situation.
154160
def are_nodes_in_sync(names):
@@ -197,7 +203,7 @@ def sleep_forever():
197203
connect_the_dots(peer_names)
198204
print("Got the following peers' fqdm from DNS lookup:",peer_names,flush=True)
199205
# loop until all CouchDB nodes discovered
200-
while not are_nodes_in_sync(names):
206+
while not are_nodes_in_sync(peer_names):
201207
time.sleep(5)
202208
peer_names = discover_peers(construct_service_record())
203209
connect_the_dots(peer_names)

0 commit comments

Comments
 (0)