Browse Source

change herounion server url

master
filesite 8 months ago
parent
commit
b023daa963
  1. 4
      config.mjs
  2. 4
      lib/taskMoniter.mjs
  3. 4
      spider.mjs

4
config.mjs

@ -6,7 +6,7 @@ export default {
//HeroUnion英雄联盟对接配置 //HeroUnion英雄联盟对接配置
herounion: { herounion: {
server_url: 'http://127.0.0.1:8080', //联盟服务地址 server_url: 'https://herounion.filesite.io', //联盟服务地址
name: 'machete_hero', //爬虫名字 name: 'machete_hero', //爬虫名字
description: '支持Machete的TaJian皮肤的hero爬虫', //爬虫简介 description: '支持Machete的TaJian皮肤的hero爬虫', //爬虫简介
platforms: 'douyin,kuaishou,xigua,bilibili', //爬虫支持的平台 platforms: 'douyin,kuaishou,xigua,bilibili', //爬虫支持的平台
@ -56,4 +56,4 @@ export default {
android_wechat: 'Mozilla/5.0 (Linux; Android 7.1.1; OD103 Build/NMF26F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN', android_wechat: 'Mozilla/5.0 (Linux; Android 7.1.1; OD103 Build/NMF26F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043632 Safari/537.36 MicroMessenger/6.6.1.1220(0x26060135) NetType/4G Language/zh_CN',
} }
}; };

4
lib/taskMoniter.mjs

@ -19,7 +19,7 @@ import HeroBot from "./heroBot.mjs";
class TaskMoniter { class TaskMoniter {
constructor(task_list_dir) { constructor(task_list_dir) {
this.check_time_gap = 30; //检测间隔时间,单位:秒 this.check_time_gap = 60; //检测间隔时间,单位:秒
this.checking = false; this.checking = false;
this.task_dir = task_list_dir; //监控目录:任务列表保存目录 this.task_dir = task_list_dir; //监控目录:任务列表保存目录
@ -209,4 +209,4 @@ class TaskMoniter {
} }
} }
export default TaskMoniter; export default TaskMoniter;

4
spider.mjs

@ -101,7 +101,7 @@ import cron from 'node-cron';
); );
//爬虫心跳上报 //爬虫心跳上报
const heartBeatFrequence = 60; //1 分钟上报一次 const heartBeatFrequence = 300; //5 分钟上报一次
const heroUnionHeartBeat = cron.schedule(`*/${heartBeatFrequence} * * * * *`, async () => { const heroUnionHeartBeat = cron.schedule(`*/${heartBeatFrequence} * * * * *`, async () => {
let status = spider_is_running ? 'busy' : 'idle'; let status = spider_is_running ? 'busy' : 'idle';
const res = await heroBot.heartBeat(status); const res = await heroBot.heartBeat(status);
@ -112,4 +112,4 @@ import cron from 'node-cron';
})().catch(error => { })().catch(error => {
console.error("Spider error got:\n%s", error); console.error("Spider error got:\n%s", error);
process.exit(1); process.exit(1);
}); });

Loading…
Cancel
Save