Skip to content

Commit

Permalink
如果前一次是 404 就直接 regenerateInfo, 可以跳過 404 #1
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnywang committed Jan 7, 2014
1 parent df3e164 commit b755cc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webdata/models/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public static function fetchRaw($news, $wait_time = 0)
'time' => $now,
'raw' => $content,
));

if (404 == $last_info->title) {
// 如果上一次是 404 這一次卻不是,直接 regenerateInfo() 最快..
return $news->regenerateInfo();
}
NewsInfo::insert(array(
'news_id' => $news->id,
'time' => $now,
Expand Down

0 comments on commit b755cc8

Please sign in to comment.