将抓取失败记录的任务单独分离出来

This commit is contained in:
zhl 2019-05-15 20:01:59 +08:00
parent de0ab431de
commit 539ff78e70
4 changed files with 7 additions and 3 deletions

View File

@ -11,8 +11,9 @@ let config = {
logs_path: '/Users/zhl/Documents/logs/spider',
download_path: '/Users/zhl/Documents/spider',
schedule: {
website: '0 0 2 * * *',
proxy: '1 0 0 * * *'
website: '1 0 0 * * *',
proxy: '0 0 23 * * *',
common: '0 0 3 * * *'
}
};

View File

@ -41,7 +41,7 @@ const Movies = new Schema({
// 是否公开
open: {type: Boolean, default: false},
// 购买价格
price: {type: Number, default: 10},
price: {type: Number, default: 100},
// 是否是新记录
is_new: {type: Boolean, default: true},
// 视频分类movie: 电影tv: 电视剧; show: 综艺节目

View File

@ -12,6 +12,8 @@ export default {
} catch (err) {
console.log('error execute dandanzan');
}
});
schedule.scheduleJob(config.schedule.common, async () => {
try {
await commonTask.run();
} catch (err) {

View File

@ -22,6 +22,7 @@ const parseOneRecord = async function (record) {
}
const parseAllRecord = async function () {
console.log('begin parse all false record');
let records;
try {
records = await CrawlRecord.find({lastStatus: false});