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 May 7, 2019
1 parent 0aaa100 commit b2ce151
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 @@ -65,7 +66,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 b2ce151

Please sign in to comment.