1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Console\Commands;
- use App\DataApi\Helper\VisitCountHelper;
- use Illuminate\Support\Facades\Log;
- class VisitCountToDb extends \Illuminate\Console\Command
- {
- protected $signature = "visit_count:todb";
- protected $description = 'visit_count todb';
- public function __construct()
- {
- parent::__construct();
- }
- public function handle()
- {
- (new VisitCountHelper())->visitCountToDb();
- Log::info('定时任务:执行完成访问点击入库,等待下次执行');
- $i = 0;
- while ($i < 300) {
- sleep(1);
- $i++;
- }
- $this->handle();
- }
- }
|