Skip to content

Commit 41b3356

Browse files
committed
style
1 parent 37e117c commit 41b3356

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ydb/_topic_reader/topic_reader_asyncio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,9 @@ def _on_start_partition_session(
470470
def _on_partition_session_stop(
471471
self, message: StreamReadMessage.StopPartitionSessionRequest
472472
):
473-
partition = self._partition_sessions.get(message.partition_session_id)
474-
if partition is None:
473+
try:
474+
partition = self._partition_sessions.get(message.partition_session_id)
475+
except KeyError:
475476
# may if receive stop partition with graceful=false after response on stop partition
476477
# with graceful=true and remove partition from internal dictionary
477478
return

0 commit comments

Comments
 (0)