Kernel.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Anime\AnimeCheckImgUrlCommand;
  4. use App\Console\Test\RegisterUserCommand;
  5. use Illuminate\Console\Scheduling\Schedule;
  6. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  7. class Kernel extends ConsoleKernel
  8. {
  9. protected $commands = [
  10. Test\TestCommand::class,
  11. RegisterUserCommand::class,
  12. AnimeCheckImgUrlCommand::class,
  13. ];
  14. /**
  15. * Define the application's command schedule.
  16. *
  17. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  18. * @return void
  19. */
  20. protected function schedule(Schedule $schedule)
  21. {
  22. // 每分钟检查一次图片生成任务状态
  23. $schedule->command('AIGeneration:checkImgTasks')->everyMinute();
  24. // 每分钟检查一次视频生成任务状态
  25. $schedule->command('AIGeneration:checkVideoTasks')->everyMinute();
  26. // 没分钟检查一次动漫对话图片生成状态
  27. $schedule->command('Anime:checkImgUrl')->everyMinute();
  28. }
  29. /**
  30. * Register the commands for the application.
  31. *
  32. * @return void
  33. */
  34. protected function commands()
  35. {
  36. $this->load(__DIR__ . '/Commands');
  37. require base_path('routes/console.php');
  38. }
  39. }