From 734c6419b9a3c8a83ec8570b1c9e5f0d21c19300 Mon Sep 17 00:00:00 2001 From: Akshita-2307 Date: Fri, 29 May 2026 23:21:17 +0530 Subject: [PATCH] Implement in-memory caching for projects.json (fixes #673, #472) --- utils/data_loader.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/data_loader.py b/utils/data_loader.py index 569199d1..15397c5e 100644 --- a/utils/data_loader.py +++ b/utils/data_loader.py @@ -9,9 +9,11 @@ def load_all_projects(): - """Read and return the full list of projects from the JSON file.""" - with open(DATA_FILE, "r", encoding="utf-8") as f: - return json.load(f) + global _projects_cache + if _projects_cache is None: + with open(DATA_FILE, "r", encoding="utf-8") as f: + _projects_cache = json.load(f) + return _projects_cache def find_project_by_id(project_id):