File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,19 @@ def discover_peers(service_record):
35
35
print ("\t Got the following peers' fqdm from DNS lookup:" ,result ,flush = True )
36
36
return result
37
37
38
+ def backoff_hdlr (details ):
39
+ print ("Backing off {wait:0.1f} seconds afters {tries} tries "
40
+ "calling function {target} with args {args} and kwargs "
41
+ "{kwargs}" .format (** details ))
42
+
43
+ def pod_not_ready_yet (details ):
44
+ print ('\t Connection failure. CouchDB is not responding. Will retry.' )
45
+
38
46
@backoff .on_exception (
39
47
backoff .expo ,
40
48
requests .exceptions .ConnectionError ,
41
- max_tries = 10
49
+ max_tries = 3 ,
50
+ on_giveup = pod_not_ready_yet
42
51
)
43
52
def connect_the_dots (names ):
44
53
@@ -75,7 +84,7 @@ def connect_the_dots(names):
75
84
uri = "http://127.0.0.1:5986/_nodes/couchdb@{0}" .format (name )
76
85
doc = {}
77
86
print ('Adding CouchDB cluster node' , name , "to this pod's CouchDB." )
78
- print ('\t Request: GET ' ,uri )
87
+ print ('\t Request: PUT ' ,uri )
79
88
if creds [0 ] and creds [1 ]:
80
89
resp = requests .put (uri , data = json .dumps (doc ), auth = creds )
81
90
else :
You can’t perform that action at this time.
0 commit comments