We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65cac6d commit 95cba05Copy full SHA for 95cba05
app.py
@@ -23,6 +23,12 @@
23
sampler=ProbabilitySampler(rate=1.0),
24
)
25
26
+# Get Pool Size
27
+if 'POOL_SIZE' in os.environ:
28
+ pool_size = int(os.environ['POOL_SIZE'])
29
+else:
30
+ pool_size = 10
31
+
32
# Setup Flask Restful framework
33
api = Api(app)
34
parser = reqparse.RequestParser()
@@ -76,7 +82,7 @@ def is_retriable(self, value):
76
82
def __getConnection(self):
77
83
self.__lock.acquire()
78
84
idx = self.__conn_index + 1
79
- if idx > 9: idx = 0
85
+ if idx > pool_size: idx = 1
80
86
self.__conn_index = idx
81
87
self.__lock.release()
88
0 commit comments