Fix snapshot handling logic to correctly process files during monitoring

Co-authored-by: jxxghp <jxxghp@163.com>
This commit is contained in:
Cursor Agent
2025-07-05 07:22:44 +00:00
parent d8249d4e38
commit 764c10fae4
2 changed files with 4 additions and 105 deletions

View File

@@ -147,7 +147,7 @@ class Monitor(metaclass=Singleton):
"""
try:
logger.info(f"开始强制全量扫描: {storage}:{mon_path}")
# 生成快照
new_snapshot = StorageChain().snapshot_storage(
storage=storage,
@@ -175,12 +175,12 @@ class Monitor(metaclass=Singleton):
continue
logger.info(f"{storage}:{mon_path} 全量扫描完成,共处理 {processed_count}/{file_count} 个文件")
# 保存快照
self.save_snapshot(storage, new_snapshot, file_count)
return True
except Exception as e:
logger.error(f"强制全量扫描失败: {storage}:{mon_path} - {e}")
return False