debug
This commit is contained in:
@@ -53,13 +53,32 @@ class Scheduler
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function crawLatest()
|
||||
{
|
||||
$arrUri = [];
|
||||
$strUri = '/list/lastupdate_%s_0_0_%s.html';
|
||||
|
||||
for ($intCategoryKey = 0; $intCategoryKey < 10; $intCategoryKey++) {
|
||||
for ($intPage = 1; $intPage <= 10; $intPage++) {
|
||||
$arrUri[] = sprintf($strUri, $intCategoryKey, $intPage);
|
||||
}
|
||||
}
|
||||
|
||||
print_r($arrUri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param array $arrFilter
|
||||
* @return void
|
||||
*/
|
||||
public function fetchNovel(array $arrFilter) //(int $intNSourceId, int $intPage = 0)
|
||||
public function fetchNovel(array $arrFilter)
|
||||
{
|
||||
$arrTask = [
|
||||
'callback' => [self::class, 'getNovelInfo'],
|
||||
|
||||
@@ -31,13 +31,20 @@ class PlanTask
|
||||
case 'PULL_630_ZW_NOVEL':
|
||||
self::pull630ZwNovel();
|
||||
break;
|
||||
|
||||
case 'PULL_630_ZW_NOVEL_LATEST':
|
||||
self::pull630ZwNovelLatest();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function pull630ZwNovel()
|
||||
{
|
||||
$arrTask = [
|
||||
@@ -48,4 +55,20 @@ class PlanTask
|
||||
$QueueManage = new QueueManage();
|
||||
$QueueManage->set($arrTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function pull630ZwNovelLatest()
|
||||
{
|
||||
$arrTask = [
|
||||
'callback' => [Zw630Scheduler::class, 'crawLatest'],
|
||||
'data' => []
|
||||
];
|
||||
|
||||
$QueueManage = new QueueManage();
|
||||
$QueueManage->set($arrTask);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,10 @@ class PlanTaskSeeder
|
||||
{
|
||||
static public function handle()
|
||||
{
|
||||
|
||||
self::addNovelTypePlanTask();
|
||||
}
|
||||
|
||||
|
||||
// 添加小说类型站点 爬虫任务
|
||||
static public function addNovelTypePlanTask()
|
||||
{
|
||||
$arrDataNovel = [
|
||||
@@ -25,8 +23,14 @@ class PlanTaskSeeder
|
||||
'pt_enable' => 1,
|
||||
'pt_limit' => 10 * 24 * 3600 * 3,
|
||||
],
|
||||
|
||||
[
|
||||
'pt_name' => '630小说每日增量',
|
||||
'pt_code' => 'PULL_630_ZW_NOVEL_LATEST',
|
||||
'pt_enable' => 1,
|
||||
'pt_limit' => 1 * 24 * 3600,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($arrDataNovel as $arrPlanTask) {
|
||||
$NovelOnePlanTaskModel = PlanTaskModel::where('pt_code', $arrPlanTask['pt_code'])->find();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user