Skip to content

Commit c18a32f

Browse files
committed
fix connection pool check_close_callback
1 parent 7d52c2d commit c18a32f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tormysql/pool.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def check_close_callback(self):
167167
self._check_close_callback = False
168168
for connection in list(self._connections):
169169
if connection.open:
170-
connection._handle_read()
170+
connection.socket._handle_read()
171171

172172
def connection_close_callback(self, connection):
173173
try:
@@ -180,10 +180,9 @@ def connection_close_callback(self, connection):
180180
except ValueError:
181181
logging.warning("Close unknown Connection %s", connection)
182182
if self._close_future and not self._used_connections and not self._connections:
183-
def do_close():
184-
self._close_future.set_result(None)
185-
self._close_future = None
186-
IOLoop.current().add_callback(do_close)
183+
close_future = self._close_future
184+
IOLoop.current().add_callback(close_future.set_result, None)
185+
self._close_future = None
187186

188187
if not self._check_close_callback:
189188
IOLoop.current().add_callback(self.check_close_callback)

0 commit comments

Comments
 (0)