fix(neo4j): use AsyncGraphDatabase for async session support
This commit is contained in:
parent
765424b7df
commit
516776896f
1 changed files with 2 additions and 2 deletions
|
|
@ -13,12 +13,12 @@ def _init() -> None:
|
|||
if _driver is not None:
|
||||
return
|
||||
try:
|
||||
from neo4j import GraphDatabase, basic_auth
|
||||
from neo4j import AsyncGraphDatabase, basic_auth
|
||||
|
||||
uri = os.getenv("NEO4J_URI", "bolt://rmi-neo4j:7687")
|
||||
user = os.getenv("NEO4J_USER", "neo4j")
|
||||
password = os.getenv("NEO4J_PASSWORD", "password")
|
||||
_driver = GraphDatabase.driver(uri, auth=basic_auth(user, password))
|
||||
_driver = AsyncGraphDatabase.driver(uri, auth=basic_auth(user, password))
|
||||
log.info("neo4j_driver_connected")
|
||||
except Exception as exc:
|
||||
log.warning("neo4j_driver_init_failed err=%s", exc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue