fix 实时软连接v1.5优化性能,提高处理速度

This commit is contained in:
thsrite
2024-06-21 21:01:47 +08:00
parent 253739f48b
commit bb4b9ee56f
4 changed files with 16 additions and 8 deletions

View File

@@ -288,8 +288,11 @@ class CloudAssistant(_PluginBase):
# 遍历所有监控目录
for mon_path in self._dirconf.keys():
# 遍历目录下所有文件
for file_path in SystemUtils.list_files(Path(mon_path), [".*"]):
self.__handle_file(event_path=str(file_path), mon_path=mon_path)
for root, dirs, files in os.walk(mon_path):
for name in dirs + files:
path = os.path.join(root, name)
if Path(path).is_file():
self.__handle_file(event_path=str(path), mon_path=mon_path)
logger.info("云盘助手全量同步监控目录完成!")
def event_handler(self, event, mon_path: str, text: str, event_path: str):