Authored by 郝肖肖

'定时推送逛文章'

... ... @@ -187,7 +187,7 @@ class SeoIndexModel extends global.yoho.BaseModel {
_getJob(params) {
let task = {};
switch(params.type) {
switch (params.type) {
case 'minute':
task = jobTask[0];
break;
... ...
... ... @@ -3,7 +3,6 @@
const ROOT_PATH = global.ROOT_PATH;
const _ = require('lodash');
const rp = require('request-promise');
const util = require(`${ROOT_PATH}/libs/util`);
const redis = require(`${ROOT_PATH}/libs/redis`);
const senUrl = 'http://data.zz.baidu.com/urls?appid=1583402501013173&token=K0L5PUhk1XOko81r&type=';
... ...
... ... @@ -21,9 +21,9 @@ const SeoTask = {
return redis.hvalsAsync(item.k).then(urls => {
console.log(`task key: ${item.k}, urls: ${JSON.stringify(urls)}, exec...`);
urls.forEach((item) => {
item = JSON.parse(item || '[]');
this.execTask(item.url, item.time);
urls.forEach(val => {
val = JSON.parse(val || '[]');
this.execTask(val.url, val.time);
});
});
});
... ...