Skip to content

Commit 954014b

Browse files
praveshkumar1988kartikpersistent
authored andcommitted
Put Grapd DB connection out of the loop to prevent pooling connection
1 parent d0e49dd commit 954014b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/score.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ async def generate():
574574
uri = url
575575
if " " in url:
576576
uri= url.replace(" ","+")
577+
graph = create_graph_database_connection(uri, userName, decoded_password, database)
578+
graphDb_data_Access = graphDBdataAccess(graph)
577579
while True:
578580
try:
579581
if await request.is_disconnected():
@@ -582,8 +584,6 @@ async def generate():
582584
# get the current status of document node
583585

584586
else:
585-
graph = create_graph_database_connection(uri, userName, decoded_password, database)
586-
graphDb_data_Access = graphDBdataAccess(graph)
587587
result = graphDb_data_Access.get_current_status_document_node(file_name)
588588
if len(result) > 0:
589589
status = json.dumps({'fileName':file_name,

0 commit comments

Comments
 (0)