From 451cf5f6ee82b77ef7bbde8219013fc22e444e62 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 13 Apr 2024 15:06:49 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8E=BB=E9=99=A4=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/pluginautoupdate/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/pluginautoupdate/__init__.py b/plugins/pluginautoupdate/__init__.py index b7cf787..3ea304d 100644 --- a/plugins/pluginautoupdate/__init__.py +++ b/plugins/pluginautoupdate/__init__.py @@ -46,7 +46,6 @@ class PluginAutoUpdate(_PluginBase): _msgtype = None _update_ids = [] _exclude_ids = [] - _run_cnt = 0 # 定时器 _scheduler: Optional[BackgroundScheduler] = None @@ -79,13 +78,10 @@ class PluginAutoUpdate(_PluginBase): self._scheduler.add_job(func=self.__plugin_update, trigger=CronTrigger.from_crontab(self._cron), name="插件自动更新") - self._run_cnt += 1 except Exception as err: logger.error(f"定时任务配置错误:{str(err)}") - if self._onlyonce or self._run_cnt == 0: - self._run_cnt += 1 - + if self._onlyonce: logger.info(f"插件自动更新服务启动,立即运行一次") # 关闭一次性开关 self._onlyonce = False