This commit is contained in:
2026-04-28 11:05:42 +07:00
parent 7cace210d6
commit 81c727b7a6
8 changed files with 102 additions and 99 deletions
+6 -1
View File
@@ -28,7 +28,12 @@ class ConfigStore:
raw = self._file_path.read_text(encoding="utf-8")
data = json.loads(raw) if raw.strip() else {}
return AppConfig.model_validate(data)
cfg = AppConfig.model_validate(data)
# Auto-fill newly introduced config keys.
normalized = cfg.model_dump(mode="json")
if normalized != data:
self._write_unlocked(cfg)
return cfg
async def save(self, cfg: AppConfig) -> None:
async with self._lock: