Skip to content

Commit 633f2d4

Browse files
committed
fix acquire method
1 parent b1a1849 commit 633f2d4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ydb/aio/coordination/lock.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,10 @@ async def __aenter__(self):
116116
)
117117

118118
await self.send(req)
119+
await self._wait_for_response(req_id, kind="acquire")
120+
121+
return self
119122

120-
resp = await self._wait_for_response(req_id, kind="acquire")
121-
if resp.acquired:
122-
return self
123-
else:
124-
raise issues.Error(f"Failed to acquire lock: {resp.issues}")
125123

126124
async def __aexit__(self, exc_type, exc, tb):
127125
if self._req_id is not None:

0 commit comments

Comments
 (0)