...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
* Date: 2023/9/14
|
|
|
* Time: 15:42
|
|
|
*/
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
use App\Http\Controllers\Api\NoticeController;
|
...
|
...
|
@@ -28,7 +29,8 @@ class DownloadFile extends Command |
|
|
*/
|
|
|
protected $description = '处理网站';
|
|
|
|
|
|
public function handle(){
|
|
|
public function handle()
|
|
|
{
|
|
|
while (true) {
|
|
|
try {
|
|
|
$this->websiteHandle();
|
...
|
...
|
@@ -43,23 +45,26 @@ public function handle(){ |
|
|
/**
|
|
|
* 处理HTML
|
|
|
*/
|
|
|
public function websiteHandle(){
|
|
|
public function websiteHandle()
|
|
|
{
|
|
|
$info = Redis::get('handle_html');
|
|
|
if (!empty($info)){
|
|
|
if (!empty($info)) {
|
|
|
$this->output('网站更新开始');
|
|
|
$noticeController = new NoticeController();
|
|
|
$infoArr = json_decode($info,true);
|
|
|
if ($infoArr["num"] < 3){
|
|
|
$infoArr = json_decode($info, true);
|
|
|
if ($infoArr["num"] < 3) {
|
|
|
$isSuccess = $noticeController->websiteHtmlHandle($infoArr["url"], $infoArr["domain"]);
|
|
|
if ($isSuccess){
|
|
|
if ($isSuccess) {
|
|
|
Redis::del('handle_html');
|
|
|
}else{
|
|
|
} else {
|
|
|
$infoArr["num"]++;
|
|
|
Redis::set('handle_html',json_encode($infoArr));
|
|
|
Redis::set('handle_html', json_encode($infoArr));
|
|
|
}
|
|
|
}else{
|
|
|
} else {
|
|
|
Redis::del('handle_html');
|
|
|
Log::info("网站处理失败!",$infoArr);
|
|
|
Log::info("网站处理失败!", $infoArr);
|
|
|
}
|
|
|
$this->output('网站更新结束');
|
|
|
}
|
|
|
return true;
|
|
|
}
|
...
|
...
|
|