Skip to content

Commit 00953d6

Browse files
committed
Context manager.
1 parent 8a7e705 commit 00953d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/oumi/core/async_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ def safe_asyncio_run(main: Awaitable[T]) -> T:
2020
Returns:
2121
The result of the awaitable.
2222
"""
23-
pool = ThreadPool(processes=1)
24-
return pool.apply(asyncio.run, (main,)) # type: ignore
23+
with ThreadPool(processes=1) as pool:
24+
return pool.apply(asyncio.run, (main,)) # type: ignore

0 commit comments

Comments
 (0)