fix 修复多个任务立即运行一次

This commit is contained in:
thsrite
2024-04-13 22:44:32 +08:00
parent ed8ec087dd
commit 3cf562e62b
3 changed files with 8 additions and 7 deletions

View File

@@ -83,11 +83,6 @@ class CustomCommand(_PluginBase):
tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3),
name=name,
args=[name, command])
# 关闭一次性开关
self._onlyonce = False
# 保存配置
self.__update_config()
else:
try:
self._scheduler.add_job(func=self.__execute_command,
@@ -102,6 +97,11 @@ class CustomCommand(_PluginBase):
else:
logger.error(f"{time_conf} 配置错误,跳过处理")
if self._onlyonce:
# 关闭一次性开关
self._onlyonce = False
# 保存配置
self.__update_config()
# 启动任务
if self._scheduler.get_jobs():
self._scheduler.print_jobs()