OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
Added max size to flow locks cache
Lucas Oliveira65da4ec0c89a
diff --git a/src/services/flows_service.py b/src/services/flows_service.pyindex 294677e50..a034371e1 100644--- a/src/services/flows_service.py+++ b/src/services/flows_service.py@@ -17,6 +17,7 @@ from datetime import datetimefrom utils.logging_config import get_loggerfrom utils.telemetry import TelemetryClient, Category, MessageIdimport asyncio+from cachetools import LRUCachelogger = get_logger(__name__)@@ -79,7 +80,7 @@ class FlowsService:# Cache for flow file mappings to avoid repeated filesystem scansself._flow_file_cache = {}# Semaphores to prevent race conditions when updating the same flow concurrently- self._flow_locks = {}+ self._flow_locks = LRUCache(maxsize=128)self._lock_creation_lock = asyncio.Lock()# Cache for enabled models to avoid redundant API callsself._enabled_models_cache = None