Kernel.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. SegmentCheckAudioCommand::class
  16. ];
  17. /**
  18. * Define the application's command schedule.
  19. *
  20. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  21. * @return void
  22. */
  23. protected function schedule(Schedule $schedule)
  24. {
  25. // 检查图片生成任务状态
  26. $schedule->command('AIGeneration:checkImgTasks')->everyMinute();
  27. // 检查视频生成任务状态
  28. $schedule->command('AIGeneration:checkVideoTasks')->everyMinute();
  29. // 检查动漫对话图片生成状态
  30. $schedule->command('Anime:checkImgUrl')->everyMinute();
  31. // 检查分镜音频生成状态
  32. $schedule->command('Segment:checkAudio')->everyMinute();
  33. // 处理图片生成任务队列
  34. $schedule->command('image-generation:process-queue')->everyMinute();
  35. }
  36. /**
  37. * Register the commands for the application.
  38. *
  39. * @return void
  40. */
  41. protected function commands()
  42. {
  43. $this->load(__DIR__ . '/Commands');
  44. require base_path('routes/console.php');
  45. }
  46. }