From b3fd941bf63eefcb827c1846ef630aa973f07c0d Mon Sep 17 00:00:00 2001 From: Christophe Bornet Date: Fri, 17 Jan 2025 18:18:45 +0100 Subject: [PATCH] fix: Fix mem leak in Graph process (#5751) Fix mem leak in Graph process --- src/backend/base/langflow/graph/graph/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/backend/base/langflow/graph/graph/base.py b/src/backend/base/langflow/graph/graph/base.py index 7339c169e..f7b3eec89 100644 --- a/src/backend/base/langflow/graph/graph/base.py +++ b/src/backend/base/langflow/graph/graph/base.py @@ -1515,11 +1515,10 @@ class Graph: to_process = deque(first_layer) layer_index = 0 chat_service = get_chat_service() - run_id = uuid.uuid4() - self.set_run_id(run_id) + self.set_run_id() self.set_run_name() await self.initialize_run() - lock = chat_service.async_cache_locks[self.run_id] + lock = asyncio.Lock() while to_process: current_batch = list(to_process) # Copy current deque items to a list to_process.clear() # Clear the deque for new items