Skip to content

Commit

Permalink
fix check wait_executor
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby committed May 4, 2023
1 parent 853d588 commit 85882de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ydb/_grpc/grpcwrapper/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(self, convert_server_grpc_to_wrapper):
self._wait_executor = None

def __del__(self):
self._wait_executor.shutdown(wait=False)
self._clean_executor(wait=False)

async def start(self, driver: SupportedDriverType, stub, method):
if asyncio.iscoroutinefunction(driver.__call__):
Expand All @@ -175,11 +175,11 @@ def close(self):
if self._stream_call:
self._stream_call.cancel()

self._clean_executor()
self._clean_executor(wait=True)

def _clean_executor(self):
def _clean_executor(self, wait: bool):
if self._wait_executor:
self._wait_executor.shutdown()
self._wait_executor.shutdown(wait)

async def _start_asyncio_driver(self, driver: ydb.aio.Driver, stub, method):
requests_iterator = QueueToIteratorAsyncIO(self.from_client_grpc)
Expand Down

0 comments on commit 85882de

Please sign in to comment.