Files
aaPanel/script/crontab_task_exec.py
Jack a24f2e23c6 Update to 7.25.0
1. Added Mail Marketing Automation trigger tasks
2. Added Mail Marketing Groups Import, Export, Merge
3. Added Mail Marketing Subscribers to support paste import
4. Added Mail Marketing Template Import Export Duplicate
5. Added Mail server add timed automatic reply
6. Added HTTPS Protection function for Website (disables automatic HTTP to HTTPS redirection when enabled)
7. Optimize Website Interface Button Integration
8. Optimize the response speed of WP Toolkit interface
2025-03-13 17:52:26 +08:00

43 lines
1.3 KiB
Python

#coding: utf-8
#-------------------------------------------------------------------
# aapanel
#-------------------------------------------------------------------
# Copyright (c) 2015-2099 宝塔软件(http://aapanel.com) All rights reserved.
#-------------------------------------------------------------------
# Author: hwliang <hwl@aapanel.com>
#-------------------------------------------------------------------
#------------------------------
# 任务编排调用脚本
#------------------------------
import sys,os
os.chdir('/www/server/panel')
sys.path.insert(0,'class/')
sys.path.insert(0,'class_v2/')
# import PluginLoader
import public
args = public.dict_obj()
if len(sys.argv) < 2:
print('ERROR: Task ID not found.')
sys.exit()
args.trigger_id = int(sys.argv[1])
args.model_index = 'crontab_v2'
# res = PluginLoader.module_run('trigger','test_trigger',args)
# if not res['status']:
# print(res['msg'])
# sys.exit()
import public.PluginLoader as plugin_loader
mod_file = '{}/class_v2/crontabModelV2/triggerModel.py'.format(public.get_panel_path())
plugin_class = plugin_loader.get_module(mod_file)
class_string='main'
plugin_object = getattr(plugin_class,class_string)()
def_name='test_trigger'
res=getattr(plugin_object,def_name)(args)
if res['status'] != 0 and 'message' in res:
print(res['message'])
sys.exit()