Add fallback for legacy config loading

Adds a check for the presence of 'load_config' in config_manager. If not found, uses a fallback method to support older settings.py files, improving compatibility with legacy Docker volumes.
This commit is contained in:
Broque Thomas 2026-01-07 08:47:30 -08:00
parent c7f2f95450
commit d4f1b3ed9a

View file

@ -59,7 +59,13 @@ else:
if os.path.exists(config_path):
print(f"Found config file at: {config_path}")
# Load configuration into the existing singleton instance
config_manager.load_config(config_path)
if hasattr(config_manager, 'load_config'):
config_manager.load_config(config_path)
else:
# Fallback for older settings.py in Docker volumes
print("⚠️ Legacy configuration detected: using fallback loading method")
config_manager.config_path = Path(config_path)
config_manager._load_config()
print("✅ Web server configuration loaded successfully.")
else:
print(f"🔴 WARNING: config.json not found at {config_path}. Using default settings.")