From 88e53ac9b711a17e399de5424f4e48f95e94d8a8 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Mon, 23 Mar 2026 23:34:11 +0545 Subject: [PATCH] refactor(config): Defer import ofstart_config_service to reduce startup overhead The import is now performed lazily within load_config to avoid early import errors and unnecessary loading during module initialization. - Enhancement: Lazy loading of configuration service - Bug Fix: Prevent ImportError when services.config is unavailable during startup --- config/data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/data.py b/config/data.py index 796ebbd..cafdf97 100644 --- a/config/data.py +++ b/config/data.py @@ -2,7 +2,6 @@ import json from fabric.utils import Gdk, GLib, get_relative_path, os -from services.config import start_config_service from utils.functions import parse_timeout_string APP_NAME = "modus1" @@ -29,6 +28,8 @@ MATUGEN_STATE_FILE = os.path.join(CONFIG_DIR, "matugen") def load_config(): """Load the configuration from config.json""" try: + from services.config import start_config_service + service = start_config_service() return service.get_all() except ImportError: