Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ async def run(self, args: BaseModel, cancellation_token: CancellationToken) -> A
else:
result = await self._func(**kwargs)
else:
loop = asyncio.get_running_loop()
if self._has_cancellation_support:
result = await asyncio.get_event_loop().run_in_executor(
result = await loop.run_in_executor(
None,
functools.partial(
self._func,
Expand All @@ -125,7 +126,7 @@ async def run(self, args: BaseModel, cancellation_token: CancellationToken) -> A
),
)
else:
future = asyncio.get_event_loop().run_in_executor(None, functools.partial(self._func, **kwargs))
future = loop.run_in_executor(None, functools.partial(self._func, **kwargs))
cancellation_token.link_future(future)
result = await future

Expand Down