SchedulerUtils
Project description
StrategiesManager
这是一个任务管理工具类
格式
配置文件参数:
基础必须字段:
- name 任务名称,唯一
- exec_cmd 执行命令
- exec_path 执行路径,‘/’结尾
- job_type 任务类型,1 定时任务 2 循环间隔任务 3 保活任务
可选基础字段
- desc 未使用
- enable 是否启用,默认启用 1,不启用 0
1)1 定时任务
可选字段:
- day_of_week 默认"0-6"
- hour 默认0
- minute 默认0
- second 默认0
2)2 循环间隔任务
必须字段:
- second
3)3 保活任务
必须字段:
- task_name 任务管理器的程序名.后缀
可选字段:
- second 默认5
注意:保活只支持python
1)保活只支持python
例子
配置文件:task.conf
[
{
"name": "KILL_TQ_H_KL_WEB",
"exec_cmd": "taskkill tq_server.py",
"exec_path": "./",
"job_type": 1,
"day_of_week": "0-6",
"hour": 5,
"minute": 10,
"second": 0,
"desc": "杀死天勤历史服务"
},
{
"name": "KILL_TQ_KL_PUSH",
"exec_cmd": "taskkill TQ_KL_PUSH.py",
"exec_path": "./",
"job_type": 1,
"day_of_week": "0-6",
"hour": 5,
"minute": 10,
"second": 0,
"desc": "杀死天勤推送服务"
},
{
"name": "H_KL_WEBGATE",
"exec_cmd": "python webgate.py -p 10039",
"exec_path": "./",
"job_type": 3,
"task_name": "webgate.py",
"second": 5
},
{
"name": "TQ_H_KL_WEB",
"exec_cmd": "python tq_server.py -p 10022",
"exec_path": "./",
"job_type": 3,
"task_name": "tq_server.py"
},
{
"name": "FT_H_KL_WEB",
"exec_cmd": "python ft_server.py -p 10023",
"exec_path": "./",
"job_type": 3,
"task_name": "ft_server.py"
},
{
"name": "TQ_KL_PUSH",
"exec_cmd": "python TQ_KL_PUSH.py",
"exec_path": "G:/WS_VS/InQuoteKLPushService-idea/",
"job_type": 3,
"task_name": "TQ_KL_PUSH.py",
"enable": 1
}
]
例子:
from framework.keepalive_task import doJobs
doJobs(path='./conf/task.conf')
更新日志
- 2020.09.18
- 完成基本定时任务启动框架
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
SchedulerUtils-1.0.1.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for SchedulerUtils-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c434985b789200debe83183a3ca9e689400fa6297b2f837b67d22a8cc4a7e007 |
|
MD5 | 43c8b9e6eae82d46aac9041c4c84ef71 |
|
BLAKE2b-256 | 13ccaac43f89cd5fc1b41094674683d3282533240dc7646df70d084161c8827a |