Authored by 陈峰

commit

@@ -7,12 +7,13 @@ const {logger} = require('./libs/logger'); @@ -7,12 +7,13 @@ const {logger} = require('./libs/logger');
7 const spiderTask = require('./tasks/spider-task'); 7 const spiderTask = require('./tasks/spider-task');
8 const calvAvgTask = require('./tasks/calc-task'); 8 const calvAvgTask = require('./tasks/calc-task');
9 const clearTask = require('./tasks/clear-task'); 9 const clearTask = require('./tasks/clear-task');
10 -const priceTask = require('./tasks/price-task'); 10 +
  11 +// const priceTask = require('./tasks/price-task');
11 12
12 global.isProduction = process.env.NODE_ENV === 'production'; 13 global.isProduction = process.env.NODE_ENV === 'production';
13 global.sender = new Sender(config.monitorReport); // 初始化数据上报 14 global.sender = new Sender(config.monitorReport); // 初始化数据上报
14 15
15 -schedule.scheduleJob('0 */30 * * * *', () => { 16 +schedule.scheduleJob('0 */15 * * * *', () => {
16 logger.info('[process]task start spiderTask'); 17 logger.info('[process]task start spiderTask');
17 spiderTask(dayjs().unix()); 18 spiderTask(dayjs().unix());
18 }); 19 });
@@ -27,8 +28,7 @@ schedule.scheduleJob('0 59 23 * * *', () => { @@ -27,8 +28,7 @@ schedule.scheduleJob('0 59 23 * * *', () => {
27 clearTask(); 28 clearTask();
28 }); 29 });
29 30
30 -schedule.scheduleJob('0 10 * * * *', () => {  
31 - logger.info('[process]task start priceTask');  
32 - priceTask();  
33 -});  
34 -priceTask(); 31 +// schedule.scheduleJob('0 10 * * * *', () => {
  32 +// logger.info('[process]task start priceTask');
  33 +// priceTask();
  34 +// });
@@ -8,7 +8,7 @@ const {logger} = require('../libs/logger'); @@ -8,7 +8,7 @@ const {logger} = require('../libs/logger');
8 const {sendMessage} = require('../libs/influx-report'); 8 const {sendMessage} = require('../libs/influx-report');
9 9
10 module.exports = async(time) => { 10 module.exports = async(time) => {
11 - spider(sknsData.map(p => p.productId)) 11 + spider(sknsData.map(p => p.productId), 'http://du.hupu.com/mapi/product/detail', {}, 1)
12 .forEach(promise => promise.then(result => { 12 .forEach(promise => promise.then(result => {
13 if (result.status !== 200 && !_.has(result, 'data.detail')) { 13 if (result.status !== 200 && !_.has(result, 'data.detail')) {
14 logger.warn(`[spider-task]爬取失败记录: ${JSON.stringify(result)}`); 14 logger.warn(`[spider-task]爬取失败记录: ${JSON.stringify(result)}`);