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
This commit is contained in:
sankalp committed 2026-03-23 23:34:11 +05:45
1 parent 231645d8f9
commit 88e53ac9b7
1 file changed
+2 -1
+2 -1
View File
@@ -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: