diff --git a/app/chain/system.py b/app/chain/system.py index 7c072af6a..3198ddf07 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -165,7 +165,7 @@ class SystemChain(ChainBase): for item in backup_dir.iterdir(): if ( item.name == SystemChain._plugin_restore_pending_file - or item.name.startswith(".") + or SystemChain.__is_snapshot_artifact(item.name) ): continue target_path = plugins_dir / item.name @@ -205,6 +205,11 @@ class SystemChain(ChainBase): if backup_dir.exists(): SystemChain.__write_plugin_restore_pending(pending_file, {}) + @staticmethod + def __is_snapshot_artifact(name: str) -> bool: + """识别快照替换过程中生成的临时或旧快照条目。""" + return bool(re.fullmatch(r"\..+\.(?:tmp|old)-[0-9a-f]{32}", name)) + @staticmethod def __read_plugin_restore_pending(pending_file: Path) -> Optional[dict[str, bool]]: """读取仍需恢复的插件项目;无效内容按全部项目重试。"""