Commit 66ab9bf1 authored by hj's avatar hj

更新提交

parent 679f38fa
...@@ -92,7 +92,8 @@ class CheMenuService ...@@ -92,7 +92,8 @@ class CheMenuService
try{ try{
$pageUrl = $url['url']; $pageUrl = $url['url'];
SimpleLogs::writeLog('开始抓取'.$pageUrl.'页面数据', 'chemenu info', 'info'); SimpleLogs::writeLog('开始抓取'.$pageUrl.'页面数据', 'chemenu info', 'info');
sleep(2); $randomFloat = 2 + mt_rand(0, 2) + (mt_rand(0, 999) / 1000);
usleep($randomFloat * 1000000); // 微秒级延迟
$responseHtml = $this->apiService->getPage($pageUrl); $responseHtml = $this->apiService->getPage($pageUrl);
//file_put_contents('./test3.html', $responseHtml); //file_put_contents('./test3.html', $responseHtml);
if($responseHtml){ if($responseHtml){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment