Ken Wiltshire commited on
Commit
bae5305
·
1 Parent(s): d5e7614

event loop issue

Browse files
graph_chunk_entity_relation.gefx DELETED
The diff for this file is too large to render. See raw diff
 
lightrag/lightrag.py CHANGED
@@ -52,15 +52,13 @@ from .base import (
52
  QueryParam,
53
  )
54
 
55
-
56
  def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
57
  try:
58
- loop = asyncio.get_running_loop()
59
  except RuntimeError:
60
  logger.info("Creating a new event loop in main thread.")
61
- # loop = asyncio.new_event_loop()
62
- # asyncio.set_event_loop(loop)
63
- loop = asyncio.get_event_loop()
64
  return loop
65
 
66
 
 
52
  QueryParam,
53
  )
54
 
 
55
  def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
56
  try:
57
+ loop = asyncio.get_event_loop()
58
  except RuntimeError:
59
  logger.info("Creating a new event loop in main thread.")
60
+ loop = asyncio.new_event_loop()
61
+ asyncio.set_event_loop(loop)
 
62
  return loop
63
 
64