| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace App\Console\Commands;
- use App\Services\AIGeneration\AIVideoGenerationService;
- use Illuminate\Console\Command;
- class CheckVideoGenerationTasksCommand extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'AIGeneration:checkVideoTasks';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '检查视频生成任务状态并更新结果';
- /**
- * Execute the console command.
- *
- * @return int
- */
- public function handle(AIVideoGenerationService $videoGenerationService)
- {
- $this->info('开始检查视频生成任务状态...');
-
- try {
- // 更新所有待处理的视频生成任务状态
- $videoGenerationService->updatePendingTasks();
-
- $this->info('视频生成任务状态检查完成');
- } catch (\Exception $e) {
- $this->error('视频生成任务状态检查失败: ' . $e->getMessage());
- return 1;
- }
- return 0;
- }
- }
|