From c99543c665bf5af6ad446035c2e642d9abd57a1c Mon Sep 17 00:00:00 2001 From: sleikang <73560978@qq.com> Date: Sun, 10 Nov 2024 12:29:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BC=82=E6=AD=A5=E7=AD=89?= =?UTF-8?q?=E5=BE=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/filesoftlink/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index 4ff12d9..7078878 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -4,7 +4,7 @@ import re import shutil import threading import traceback -import time +import asyncio from pathlib import Path from typing import List, Tuple, Dict, Any, Optional @@ -408,7 +408,7 @@ class FileSoftLink(_PluginBase): event_path=str(src_file), mon_path=mon_path, ) - time.sleep(self._sync_interval) + asyncio.sleep(self._sync_interval) if event.event_data.get("user"): self.post_message( @@ -453,7 +453,7 @@ class FileSoftLink(_PluginBase): self.__handle_file( event_path=str(src_file), mon_path=mon_path ) - time.sleep(self._sync_interval) + asyncio.sleep(self._sync_interval) if event.event_data.get("user"): self.post_message( channel=event.event_data.get("channel"), @@ -475,7 +475,7 @@ class FileSoftLink(_PluginBase): self.__handle_file( event_path=str(src_file), mon_path=mon_path ) - time.sleep(self._sync_interval) + asyncio.sleep(self._sync_interval) if event.event_data.get("user"): self.post_message( channel=event.event_data.get("channel"), @@ -514,7 +514,7 @@ class FileSoftLink(_PluginBase): src_file = os.path.join(sroot, file_name) if Path(src_file).is_file(): self.__handle_file(event_path=str(src_file), mon_path=mon_path) - time.sleep(self._sync_interval) + asyncio.sleep(self._sync_interval) if event.event_data.get("user"): self.post_message( channel=event.event_data.get("channel"), @@ -552,7 +552,7 @@ class FileSoftLink(_PluginBase): path = os.path.join(root, name) if Path(path).is_file(): self.__handle_file(event_path=str(path), mon_path=mon_path) - time.sleep(self._sync_interval) + asyncio.sleep(self._sync_interval) logger.info("全量同步监控目录完成!") def event_handler(self, event, mon_path: str, text: str, event_path: str):