Skip to content

Commit ef7e50e

Browse files
committed
review fixes
1 parent eb98ede commit ef7e50e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ydb/aio/query/pool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import asyncio
22
import logging
3-
import functools
43
from typing import (
54
Callable,
65
Optional,
@@ -61,7 +60,8 @@ async def acquire(self) -> QuerySession:
6160
done, _ = await asyncio.wait((queue_get, task_stop), return_when=asyncio.FIRST_COMPLETED)
6261
if task_stop in done:
6362
queue_get.cancel()
64-
return await self._create_new_session()
63+
raise RuntimeError("An attempt to take session from closed session pool.")
64+
6565
task_stop.cancel()
6666
session = queue_get.result()
6767

@@ -163,7 +163,7 @@ def __del__(self):
163163
if self._should_stop.is_set() or self._loop.is_closed():
164164
return
165165

166-
self._loop.call_soon(functools.partial(self.stop))
166+
self._loop.call_soon(self.stop)
167167

168168

169169
class SimpleQuerySessionCheckoutAsync:

0 commit comments

Comments
 (0)