From 50917619f53fe0520dc16500d5f1a0832383fb81 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 23 Feb 2024 10:03:42 -0300 Subject: [PATCH] Move set cache to the end --- src/backend/langflow/api/v1/chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index ef4c01c2e..e0742a31e 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -161,7 +161,7 @@ async def build_vertex( artifacts = vertex.artifacts else: raise ValueError(f"No result found for vertex {vertex_id}") - chat_service.set_cache(flow_id, graph) + except Exception as exc: params = str(exc) valid = False @@ -191,6 +191,7 @@ async def build_vertex( if graph.inactive_vertices: inactive_vertices = list(graph.inactive_vertices) graph.reset_inactive_vertices() + chat_service.set_cache(flow_id, graph) return VertexBuildResponse( inactive_vertices=inactive_vertices,