From 34d943afbbe2e4489a3a30c29d82b6df684b2d80 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 13 Apr 2024 17:08:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=96=B9=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/pluginautoupdate/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/pluginautoupdate/__init__.py b/plugins/pluginautoupdate/__init__.py index 55fae71..01abf54 100644 --- a/plugins/pluginautoupdate/__init__.py +++ b/plugins/pluginautoupdate/__init__.py @@ -73,7 +73,7 @@ class PluginAutoUpdate(_PluginBase): if self._cron: try: - self._scheduler.add_job(func=self.__plugin_update, + self._scheduler.add_job(func=self.plugin_update, trigger=CronTrigger.from_crontab(self._cron), name="插件自动更新") except Exception as err: @@ -94,7 +94,7 @@ class PluginAutoUpdate(_PluginBase): "exclude_ids": self._exclude_ids, }) - self._scheduler.add_job(func=self.__plugin_update, trigger='date', + self._scheduler.add_job(func=self.plugin_update, trigger='date', run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(seconds=1), name="插件自动更新") @@ -104,7 +104,7 @@ class PluginAutoUpdate(_PluginBase): self._scheduler.start() @eventmanager.register(EventType.PluginAction) - def __plugin_update(self, event: Event = None): + def plugin_update(self, event: Event = None): """ 插件自动更新 """ @@ -259,7 +259,7 @@ class PluginAutoUpdate(_PluginBase): "id": "PluginAutoUpdate", "name": "插件自动更新", "trigger": CronTrigger.from_crontab(self._cron), - "func": self.__plugin_update, + "func": self.plugin_update, "kwargs": {} }] return []