Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asyncmy/connection.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class Connection:
return self._last_usage

async def ensure_closed(self):
"""Close connection without QUIT message."""
"""Send QUIT message and close connection."""
if self._connected:
send_data = i.pack(1) + B.pack(COM_QUIT)
self._write_bytes(send_data)
Expand Down
4 changes: 2 additions & 2 deletions asyncmy/pool.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Pool(asyncio.AbstractServer):

while self._free:
conn = self._free.popleft()
conn.close()
await conn.ensure_closed()

async with self._cond:
while self.size > self.freesize:
Expand Down Expand Up @@ -133,7 +133,7 @@ class Pool(asyncio.AbstractServer):

elif self._recycle > -1 and self._loop.time() - conn.last_usage > self._recycle:
self._free.pop()
conn.close()
await conn.ensure_closed()

else:
self._free.rotate()
Expand Down