Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvoleg committed Sep 9, 2024
1 parent eb98ede commit ef7e50e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ydb/aio/query/pool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import logging
import functools
from typing import (
Callable,
Optional,
Expand Down Expand Up @@ -61,7 +60,8 @@ async def acquire(self) -> QuerySession:
done, _ = await asyncio.wait((queue_get, task_stop), return_when=asyncio.FIRST_COMPLETED)
if task_stop in done:
queue_get.cancel()
return await self._create_new_session()
raise RuntimeError("An attempt to take session from closed session pool.")

task_stop.cancel()
session = queue_get.result()

Expand Down Expand Up @@ -163,7 +163,7 @@ def __del__(self):
if self._should_stop.is_set() or self._loop.is_closed():
return

self._loop.call_soon(functools.partial(self.stop))
self._loop.call_soon(self.stop)


class SimpleQuerySessionCheckoutAsync:
Expand Down

0 comments on commit ef7e50e

Please sign in to comment.