From 1900333c1467f5c8fdcdfadc3a35128d258b2a72 Mon Sep 17 00:00:00 2001 From: Allen Date: Thu, 28 Mar 2024 05:46:16 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=99=A8=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/downloaderhelper/__init__.py | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/plugins/downloaderhelper/__init__.py b/plugins/downloaderhelper/__init__.py index ccfcb91..6ff51e5 100644 --- a/plugins/downloaderhelper/__init__.py +++ b/plugins/downloaderhelper/__init__.py @@ -124,29 +124,32 @@ class DownloaderHelper(_PluginBase): 定义远程控制命令 :return: 命令关键字、事件、描述、附带数据 """ - return [{}] + pass def get_api(self) -> List[Dict[str, Any]]: """ 获取插件API """ - return [{}] + pass def get_service(self) -> List[Dict[str, Any]]: """ 注册插件公共服务 """ - cron = self.__get_config_item(config_key='cron') - if self.get_state() and cron: - return [{ - "id": "DownloaderHelperTimerService", - "name": "下载器助手定时服务", - "trigger": CronTrigger.from_crontab(cron), - "func": self.__run, - "kwargs": {} - }] - else: - return [] + try: + cron = self.__get_config_item(config_key='cron') + if self.get_state() and cron: + return [{ + "id": "DownloaderHelperTimerService", + "name": "下载器助手定时服务", + "trigger": CronTrigger.from_crontab(cron), + "func": self.__run, + "kwargs": {} + }] + else: + return [] + except Exception as e: + logger.error(f"注册插件公共服务异常: {str(e)}", exc_info=True) def get_form(self) -> Tuple[List[dict], Dict[str, Any]]: """