Skip to content

Commit

Permalink
make it work on the active queries
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan committed Feb 12, 2024
1 parent 03c17e2 commit 1204ead
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions edb/server/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,6 @@ async def ensure_database_not_connected(

self._block_new_connections.add(dbname)

# Prune our inactive connections.
await self._pg_pool.prune_inactive_connections(dbname)

# Signal adjacent servers to prune their connections to this
# database.
await self.signal_sysevent(
Expand All @@ -760,6 +757,10 @@ async def ensure_database_not_connected(

async for iteration in rloop:
async with iteration:
# Prune our inactive connections. (Do it in the loop
# to help in the close_frontend_conns situation.)
await self._pg_pool.prune_inactive_connections(dbname)

await self._pg_ensure_database_not_connected(dbname)

async def _pg_ensure_database_not_connected(self, dbname: str) -> None:
Expand Down

0 comments on commit 1204ead

Please sign in to comment.