Skip to content

Commit

Permalink
Add specific driver closing to avoid issues with neo4
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasilije1990 committed Jan 9, 2024
1 parent 0120421 commit 8aeef5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ async def unlink_user_from_public_memory(payload: Payload):
async with session_scope(session=AsyncSessionLocal()) as session:
from main import unlink_user_from_memory
# Assuming you have a method in Neo4jGraphDB to execute the query
result = await unlink_user_from_memory( user_id = decoded_payload['user_id'], topic=topic)
result = await unlink_user_from_memory( user_id = decoded_payload['user_id'], topic=topic, labels=decoded_payload['labels'])
return JSONResponse(content={"response": result}, status_code=200)

except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,10 @@ async def unlink_user_from_memory(user_id: str=None, labels:list=None, topic:str
raise ValueError("User ID is required.")
if not labels:
labels = ['sr'] # Labels for the memory node
raise ValueError("Labels are required, default label 'sr' provided")

if not topic:
topic = "PublicMemory"
raise ValueError("Topic is required, default topic 'PublicMemory' provided")


try:
neo4j_graph_db = Neo4jGraphDB(url=config.graph_database_url,
Expand Down

0 comments on commit 8aeef5c

Please sign in to comment.