Kernel.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Anime\AnimeCheckImgUrlCommand;
  4. use App\Console\Anime\SegmentCheckAudioCommand;
  5. use App\Console\Test\RegisterUserCommand;
  6. use Illuminate\Console\Scheduling\Schedule;
  7. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  8. class Kernel extends ConsoleKernel
  9. {
  10. protected $commands = [
  11. Test\TestCommand::class,
  12. RegisterUserCommand::class,
  13. AnimeCheckImgUrlCommand::class,
  14. Commands\ProcessImageGenerationQueueCommand::class,
  15. Commands\ProcessBatchEpisodeGenerationCommand::class,
  16. SegmentCheckAudioCommand::class
  17. ];
  18. /**
  19. * Define the application's command schedule.
  20. *
  21. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  22. * @return void
  23. */
  24. protected function schedule(Schedule $schedule)
  25. {
  26. // 检查图片生成任务状态
  27. $schedule->command('AIGeneration:checkImgTasks')->everyMinute();
  28. // 检查视频生成任务状态
  29. $schedule->command('AIGeneration:checkVideoTasks')->everyMinute();
  30. // 检查动漫对话图片生成状态
  31. $schedule->command('Anime:checkImgUrl')->everyMinute();
  32. // 检查分镜音频生成状态
  33. $schedule->command('Segment:checkAudio')->everyMinute();
  34. // 处理图片生成任务队列
  35. $schedule->command('image-generation:process-queue')->everyMinute();
  36. // 批量生成分集任务(每分钟执行一次,每次处理一个待生成的剧集)
  37. $schedule->command('batch:generate-episodes')->everyMinute();
  38. }
  39. /**
  40. * Register the commands for the application.
  41. *
  42. * @return void
  43. */
  44. protected function commands()
  45. {
  46. $this->load(__DIR__ . '/Commands');
  47. require base_path('routes/console.php');
  48. }
  49. }