We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6ed286 commit a97a291Copy full SHA for a97a291
app.py
@@ -85,21 +85,18 @@ def __createConnection(self, idx):
85
86
def __getConnection(self):
87
self.__lock.acquire()
88
- idx = self.__conn_index + 1
89
-
90
- if idx > 9:
91
- idx = 0
92
+ idx = self.__conn_index + 1
+ if idx > 9: idx = 0
+ self.__conn_index = idx
+ self.__lock.release()
+
93
if not idx in self.__conn_dict.keys():
94
application_name = ";APP={0}-{1}".format(socket.gethostname(), idx)
95
conn = pyodbc.connect(os.environ['SQLAZURECONNSTR_WWIF'] + application_name)
96
self.__conn_dict.update( { idx: conn } )
97
else:
98
conn = self.__conn_dict[idx]
99
100
- self.__conn_index = idx
101
- self.__lock.release()
102
103
return (idx, conn)
104
105
def __removeConnection(self, idx):
0 commit comments