fix(neo4j): use AsyncGraphDatabase for async session support

This commit is contained in:
Crypto Rug Munch 2026-07-08 07:30:04 +02:00
parent 765424b7df
commit 516776896f

View file

@ -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)