Skip to content

Commit 202e4b5

Browse files
committed
simplify stream.py + correct lock.py
1 parent 4742860 commit 202e4b5

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

ydb/aio/coordination/lock.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ async def _ensure_session(self):
7070
async def _wait_for_response(self, req_id: int, *, kind: str):
7171
try:
7272
while True:
73-
resp = await asyncio.wait_for(
74-
self._stream._incoming_queue.get(),
75-
timeout=self._wait_timeout,
76-
)
73+
resp = await self._stream.receive(self._wait_timeout)
74+
7775
fs = FromServer.from_proto(resp)
7876

7977
if kind == "acquire":

ydb/aio/coordination/stream.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ async def close(self):
9292
self._background_tasks.clear()
9393

9494
if self._stream:
95-
try:
96-
self._stream.close()
97-
except Exception:
98-
pass
95+
self._stream.close()
9996
self._stream = None
10097

10198
self.session_id = None

0 commit comments

Comments
 (0)