Browse Source

change frequence to check new task

master
filesite 1 year ago
parent
commit
d174fa9399
  1. 2
      lib/taskMoniter.mjs
  2. 1
      spider.mjs

2
lib/taskMoniter.mjs

@ -18,7 +18,7 @@ import cron from 'node-cron'; @@ -18,7 +18,7 @@ import cron from 'node-cron';
class TaskMoniter {
constructor(task_list_dir) {
this.check_time_gap = 10; //检测间隔时间,单位:秒
this.check_time_gap = 30; //检测间隔时间,单位:秒
this.checking = false;
this.task_dir = task_list_dir; //监控目录:任务列表保存目录

1
spider.mjs

@ -74,6 +74,7 @@ import cron from 'node-cron'; @@ -74,6 +74,7 @@ import cron from 'node-cron';
spider_is_running = false;
}else {
console.error('No bot matched with url %s', task.url);
taskMoniter.setTaskRunning(task.id);
taskMoniter.setTaskFailed(task.id);
}
}, {

Loading…
Cancel
Save