|
|
|
@ -19,7 +19,7 @@ import HeroBot from "./heroBot.mjs";
@@ -19,7 +19,7 @@ import HeroBot from "./heroBot.mjs";
|
|
|
|
|
|
|
|
|
|
class TaskMoniter { |
|
|
|
|
constructor(task_list_dir) { |
|
|
|
|
this.check_time_gap = 60; //检测间隔时间,单位:秒
|
|
|
|
|
this.check_time_gap = 1; //检测间隔时间,单位:分钟
|
|
|
|
|
this.checking = false; |
|
|
|
|
|
|
|
|
|
this.task_dir = task_list_dir; //监控目录:任务列表保存目录
|
|
|
|
@ -197,7 +197,7 @@ class TaskMoniter {
@@ -197,7 +197,7 @@ class TaskMoniter {
|
|
|
|
|
//auto check new tasks
|
|
|
|
|
const _self = this; |
|
|
|
|
const task_check_time = this.check_time_gap; |
|
|
|
|
const task_auto_run = cron.schedule(`*/${task_check_time} * * * * *`, async () => { |
|
|
|
|
const task_auto_run = cron.schedule(`*/${task_check_time} * * * *`, async () => { |
|
|
|
|
await _self.checkTasks(); |
|
|
|
|
console.log('Status', _self.getStatus()); |
|
|
|
|
}, { |
|
|
|
|