Skip to content

Commit

Permalink
Removed extra call to asyncio.wait_for (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfootjon committed Mar 31, 2023
1 parent be6635e commit ec4b25d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions asgiref/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ async def __call__(self, *args, **kwargs):

try:
# Run the code in the right thread
future = loop.run_in_executor(
ret = await loop.run_in_executor(
executor,
functools.partial(
self.thread_handler,
Expand All @@ -448,7 +448,6 @@ async def __call__(self, *args, **kwargs):
**kwargs,
),
)
ret = await asyncio.wait_for(future, timeout=None)

finally:
_restore_context(context)
Expand Down

0 comments on commit ec4b25d

Please sign in to comment.