| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Console\Commands;
- use App\Services\AiImageGenerationService;
- use Illuminate\Console\Command;
- class CheckImageGenerationTasksCommand extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'image-generation:check-tasks';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '检查图片生成任务状态并更新';
- /**
- * Execute the console command.
- *
- * @param AiImageGenerationService $aiImageGenerationService
- * @return int
- */
- public function handle(AiImageGenerationService $aiImageGenerationService)
- {
- $this->info('开始检查图片生成任务状态...');
- try {
- $aiImageGenerationService->updatePendingTasks();
- $this->info('任务状态检查完成');
- } catch (\Exception $e) {
- $this->error('任务状态检查失败: ' . $e->getMessage());
- return 1;
- }
- return 0;
- }
- }
|