| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- declare(strict_types=1);
- namespace App\Command;
- use App\Model\VideoModel;
- use App\Repositories\Service\CommonService;
- use App\Repositories\Utils\M3u8CacheRepository;
- use App\Repositories\VideoRepository;
- use Hyperf\Command\Command as HyperfCommand;
- use Hyperf\Command\Annotation\Command;
- use Modules\Api\Services\VideoService;
- use Psr\SimpleCache\CacheInterface;
- /**
- * @Command
- */
- class VideoHomeCacheCommand extends HyperfCommand
- {
- public function __construct()
- {
- parent::__construct('video:home');
- }
- public function configure()
- {
- parent::configure();
- $this->setDescription('首页视频流');
- }
- public function handle()
- {
- $this->info('开始缓存视频首页');
- $videoRepo = make(VideoRepository::class);
- $videoRepo->initHomeVideoGroups();
- $videoRepo->clearAllLastestPagesCache();
- logger('VideoHomeCacheCommand-缓存视频首页');
- $this->info("首页推荐视频缓存成功.");
- }
- }
|