Authored by 陈峰

commit

... ... @@ -15,10 +15,10 @@ const londonTask = require('./tasks/london-task');
global.isProduction = process.env.NODE_ENV === 'production';
global.sender = new Sender(config.monitorReport); // 初始化数据上报
// schedule.scheduleJob('0 */15 * * * *', () => {
// logger.info('[process]task start spiderTask'); // 比价任务
// spiderTask(dayjs().unix());
// });
schedule.scheduleJob('0 */15 * * * *', () => {
logger.info('[process]task start spiderTask'); // 比价任务
spiderTask(dayjs().unix());
});
schedule.scheduleJob('0 15 10 * * *', () => {
logger.info('[process]task start calvAvgTask'); // 根据比价记录表计算昨日平均价
... ...
... ... @@ -13,7 +13,7 @@ module.exports = async(data) => {
});
if (!updateRows) {
const insertRow = await mysqlPool.insert('INSERT `channel_sku_compare` (`product_id`, `sku`, `size_id`,`channel_price`, `low_rate`, `high_rate`, `channel_average_price`, `update_time`, `status`) SELECT `product_id`,`id`,`size_id`, :channelPrice, 0.05, 0, 0.00, :updateTime, 0 FROM `storage` WHERE `product_id` = :productId AND `size_id` = :sizeId', {
const insertRow = await mysqlPool.insert('INSERT `channel_sku_compare` (`product_id`, `sku`, `size_id`,`channel_price`, `low_rate`, `high_rate`, `channel_average_price`, `update_time`, `status`) SELECT `product_id`,`id`,`size_id`, :channelPrice, 0.05, 0.05, 0.00, :updateTime, 0 FROM `storage` WHERE `product_id` = :productId AND `size_id` = :sizeId', {
channelPrice: price,
updateTime: time,
productId,
... ...