File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -85,21 +85,18 @@ def __createConnection(self, idx):
85
85
86
86
def __getConnection (self ):
87
87
self .__lock .acquire ()
88
- idx = self .__conn_index + 1
89
-
90
- if idx > 9 :
91
- idx = 0
92
-
88
+ idx = self .__conn_index + 1
89
+ if idx > 9 : idx = 0
90
+ self . __conn_index = idx
91
+ self . __lock . release ()
92
+
93
93
if not idx in self .__conn_dict .keys ():
94
94
application_name = ";APP={0}-{1}" .format (socket .gethostname (), idx )
95
95
conn = pyodbc .connect (os .environ ['SQLAZURECONNSTR_WWIF' ] + application_name )
96
96
self .__conn_dict .update ( { idx : conn } )
97
97
else :
98
98
conn = self .__conn_dict [idx ]
99
99
100
- self .__conn_index = idx
101
- self .__lock .release ()
102
-
103
100
return (idx , conn )
104
101
105
102
def __removeConnection (self , idx ):
You can’t perform that action at this time.
0 commit comments