Merge pull request #432 from ChenZiHong-Gavin/main

fix(lightrag): use is_closed() instead of _closed
This commit is contained in:
zrguo 2024-12-09 18:08:43 +08:00 committed by GitHub
commit 3e112c0d05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,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