()
| 65 | |
| 66 | |
| 67 | def _save() -> None: |
| 68 | try: |
| 69 | _SETTINGS_PATH.parent.mkdir(parents=True, exist_ok=True) |
| 70 | _SETTINGS_PATH.write_text(json.dumps(_ensure()), encoding="utf-8") |
| 71 | except Exception: |
| 72 | # Persistence is best-effort (read-only FS, permissions): the in-memory |
| 73 | # value still applies for this session, so don't fail the request. |
| 74 | _log.warning("could not persist settings to %s", _SETTINGS_PATH, exc_info=True) |
| 75 | |
| 76 | |
| 77 | def _num(v: object) -> int | None: |
no test coverage detected