Skip to content

Commit

Permalink
Merge pull request #314 from ydb-platform/aio-writer-del-fix
Browse files Browse the repository at this point in the history
topic aio writer: fix __del__
  • Loading branch information
Valeria1235 committed Jun 8, 2023
2 parents 4254a17 + 3a468a2 commit 2956229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ydb/_topic_writer/topic_writer_asyncio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import concurrent.futures
import datetime
import functools
import gzip
import typing
from collections import deque
Expand Down Expand Up @@ -75,7 +76,7 @@ def __del__(self):
if self._closed or self._loop.is_closed():
return

self._loop.call_soon(self.close, False)
self._loop.call_soon(functools.partial(self.close, flush=False))

async def close(self, *, flush: bool = True):
if self._closed:
Expand Down
2 changes: 1 addition & 1 deletion ydb/_topic_writer/topic_writer_asyncio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ async def write_with_ack_future(self, messages: typing.List[InternalMessage]):
self.messages_writted.set()
return futures

async def close(self):
async def close(self, flush: bool):
pass

@pytest.fixture
Expand Down

0 comments on commit 2956229

Please sign in to comment.