fix(dashboard): rescan plugins when cached directory is removed

This commit is contained in:
liuhao1024 2026-05-12 21:57:34 +08:00 committed by Teknium
parent 6ec89d885d
commit 2a3140a814

View file

@ -4021,6 +4021,9 @@ def _get_dashboard_plugins(force_rescan: bool = False) -> list:
global _dashboard_plugins_cache
if _dashboard_plugins_cache is None or force_rescan:
_dashboard_plugins_cache = _discover_dashboard_plugins()
elif _dashboard_plugins_cache:
if any(not Path(p["_dir"]).is_dir() for p in _dashboard_plugins_cache):
_dashboard_plugins_cache = _discover_dashboard_plugins()
return _dashboard_plugins_cache