Skip to content

Commit 3a468a2

Browse files
author
Valeriya Popova
committed
topic aio writer: fix __del__
1 parent 4254a17 commit 3a468a2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ydb/_topic_writer/topic_writer_asyncio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import concurrent.futures
33
import datetime
4+
import functools
45
import gzip
56
import typing
67
from collections import deque
@@ -75,7 +76,7 @@ def __del__(self):
7576
if self._closed or self._loop.is_closed():
7677
return
7778

78-
self._loop.call_soon(self.close, False)
79+
self._loop.call_soon(functools.partial(self.close, flush=False))
7980

8081
async def close(self, *, flush: bool = True):
8182
if self._closed:

ydb/_topic_writer/topic_writer_asyncio_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ async def write_with_ack_future(self, messages: typing.List[InternalMessage]):
625625
self.messages_writted.set()
626626
return futures
627627

628-
async def close(self):
628+
async def close(self, flush: bool):
629629
pass
630630

631631
@pytest.fixture

0 commit comments

Comments
 (0)