Skip to content

Commit

Permalink
Implement prune_all_connections
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Jul 19, 2024
1 parent f10926e commit c786505
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions edb/server/connpool/pool2.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,7 @@ def __init__(self, *, connect: Connector[C],
self._successful_disconnects = 0

if stats_collector:
stats_collector(Snapshot(
timestamp=0,
capacity=10,
blocks=[],
log=[],
failed_connects=0,
failed_disconnects=0,
successful_connects=0,
successful_disconnects=0))
stats_collector(self._build_snapshot(now=0))
pass

def __del__(self) -> None:
Expand Down Expand Up @@ -214,7 +206,11 @@ async def prune_inactive_connections(self, dbname: str) -> None:
del self._prunes[id]

async def prune_all_connections(self) -> None:
pass
# Brutally close all connections. This is used by HA failover.
coros = []
for conn in self._conns.values():
coros.append(self._disconnect(conn))
await asyncio.gather(*coros, return_exceptions=True)

def get_pending_conns(self) -> int:
return 0
Expand Down

0 comments on commit c786505

Please sign in to comment.