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):
8585
8686 def __getConnection (self ):
8787 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+
9393 if not idx in self .__conn_dict .keys ():
9494 application_name = ";APP={0}-{1}" .format (socket .gethostname (), idx )
9595 conn = pyodbc .connect (os .environ ['SQLAZURECONNSTR_WWIF' ] + application_name )
9696 self .__conn_dict .update ( { idx : conn } )
9797 else :
9898 conn = self .__conn_dict [idx ]
9999
100- self .__conn_index = idx
101- self .__lock .release ()
102-
103100 return (idx , conn )
104101
105102 def __removeConnection (self , idx ):
You can’t perform that action at this time.
0 commit comments