Skip to content

Commit

Permalink
postgres: use wait_for in disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jul 14, 2019
1 parent 88b381a commit 7685960
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion databases/backends/postgres.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import logging
import typing
from collections.abc import Mapping
Expand Down Expand Up @@ -66,7 +67,7 @@ async def connect(self) -> None:

async def disconnect(self) -> None:
assert self._pool is not None, "DatabaseBackend is not running"
await self._pool.close()
await asyncio.wait_for(self._pool.close(), timeout=30)
self._pool = None

def connection(self) -> "PostgresConnection":
Expand Down

0 comments on commit 7685960

Please sign in to comment.