Kernel.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. class Kernel extends ConsoleKernel
  6. {
  7. /**
  8. * Define the application's command schedule.
  9. */
  10. protected function schedule(Schedule $schedule): void
  11. {
  12. /**
  13. * 刷新微信小程序的accessToken
  14. */
  15. $schedule->command('Miniprogram:WechatAccessToken')->everyMinute();
  16. //每月24号执行创建表
  17. $schedule->command('create_track_table')->monthlyOn(24);
  18. /**
  19. * 同步短剧剧目信息
  20. */
  21. $schedule->command('WechatCheck:SyncDramaInfo')->daily();
  22. /**
  23. * 同步短剧分集信息
  24. */
  25. $schedule->command('WechatCheck:SyncMediaInfo')->everySixHours();
  26. /**
  27. * 检查短剧剧目拉取任务
  28. */
  29. $schedule->command('WechatCheck:GetTaskInfo')->everyTenMinutes();
  30. }
  31. /**
  32. * Register the commands for the application.
  33. */
  34. protected function commands(): void
  35. {
  36. $this->load(__DIR__.'/Commands');
  37. require base_path('routes/console.php');
  38. }
  39. }