fix(lightrag): use is_closed() instead of _closed

This commit is contained in:
chenzihong
2024-12-09 17:10:13 +08:00
parent 91843267e9
commit 9dd51f1f35

View File

@@ -68,7 +68,7 @@ def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
try:
# Try to get the current event loop
current_loop = asyncio.get_event_loop()
if current_loop._closed:
if current_loop.is_closed():
raise RuntimeError("Event loop is closed.")
return current_loop