refactor(shutdown): move shutdown logic in one place

This commit is contained in:
Artem Akymenko
2026-07-12 20:19:33 +03:00
parent c380a58496
commit b7026a666d
8 changed files with 191 additions and 42 deletions
+8
View File
@@ -144,3 +144,11 @@ def _ensure_single_voice_asset(
hf_hub_download(resume_download=True, **common_kwargs)
return True
def clear_voice_cache() -> None:
"""Clear the inprocess voice cache (used during shutdown)."""
with _CACHE_LOCK:
_CACHED_VOICES.clear()
global _BOOTSTRAPPED
_BOOTSTRAPPED = False