|
|
@ -65,7 +65,7 @@ import path from 'node:path'; |
|
|
|
|
|
|
|
|
|
|
|
//随机延迟一段时间,将不同爬虫的执行时间错开
|
|
|
|
//随机延迟一段时间,将不同爬虫的执行时间错开
|
|
|
|
let rnd_secods = parseInt(Math.random() * task_check_time); |
|
|
|
let rnd_secods = parseInt(Math.random() * task_check_time); |
|
|
|
console.log("Sleep %s seconds...", rnd_secods); |
|
|
|
console.log("Sleep %s seconds before crap...", rnd_secods); |
|
|
|
await common.delay(rnd_secods); |
|
|
|
await common.delay(rnd_secods); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ import path from 'node:path'; |
|
|
|
const heroUnionHeartBeat = cron.schedule(`*/${heartBeatFrequence} * * * *`, async () => { |
|
|
|
const heroUnionHeartBeat = cron.schedule(`*/${heartBeatFrequence} * * * *`, async () => { |
|
|
|
//随机延迟一段时间,将不同爬虫的执行时间错开
|
|
|
|
//随机延迟一段时间,将不同爬虫的执行时间错开
|
|
|
|
let rnd_secods = parseInt(Math.random() * 60); |
|
|
|
let rnd_secods = parseInt(Math.random() * 60); |
|
|
|
console.log("Sleep %s seconds...", rnd_secods); |
|
|
|
console.log("Sleep %s seconds before send heart beat...", rnd_secods); |
|
|
|
await common.delay(rnd_secods); |
|
|
|
await common.delay(rnd_secods); |
|
|
|
|
|
|
|
|
|
|
|
let status = spider_is_running ? 'busy' : 'idle'; |
|
|
|
let status = spider_is_running ? 'busy' : 'idle'; |
|
|
|