Skip to content

Commit 55b1a6f

Browse files
committed
fix NEXUS-703: try to fix event loop in separate thread
1 parent d201731 commit 55b1a6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/unstructured_client/_hooks/custom/split_pdf_hook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ def _get_asyncio_loop() -> asyncio.AbstractEventLoop:
6363
loop = asyncio.get_event_loop()
6464
except RuntimeError:
6565
loop = asyncio.new_event_loop()
66+
asyncio.set_event_loop(loop)
6667
else:
6768
try:
6869
loop = asyncio.get_running_loop()
6970
except RuntimeError:
7071
loop = asyncio.new_event_loop()
71-
asyncio.set_event_loop(loop)
72+
asyncio.set_event_loop(loop)
7273
return loop
7374

7475
def _run_coroutines_in_separate_thread(

0 commit comments

Comments
 (0)