Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: ci
on:
push:
branches-ignore:
- master
- main
pull_request:
branches-ignore:
- master
jobs:
test:
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == github.repository) }}
runs-on: ubuntu-22.04
services:
mssql:
Expand Down Expand Up @@ -57,6 +58,7 @@ jobs:
COVERALLS_PARALLEL: true

coveralls:
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == github.repository) }}
name: Finish Coveralls
needs: test
runs-on: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion asyncodbc/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async def release(self, conn):
self._terminated.remove(conn)
return
self._used.remove(conn)
if not conn.closed:
if conn.connected and not conn.closed:
if self._closing:
await conn.close()
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ async def test_release_closed(pool):
assert 0 == pool.freesize
await conn.close()
await pool.release(conn)
assert 1 == pool.freesize
assert 0 == pool.freesize
assert not pool._used
assert 1 == pool.size
assert 0 == pool.size

conn2 = await pool.acquire()
assert 0 == pool.freesize
Expand Down