Kernel.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\Apollo;
  4. use App\Console\Commands\Downloads;
  5. use App\Console\Commands\PostYesterday;
  6. use Illuminate\Console\Scheduling\Schedule;
  7. use Laravel\Lumen\Console\Kernel as ConsoleKernel;
  8. class Kernel extends ConsoleKernel
  9. {
  10. /**
  11. * The Artisan commands provided by your application.
  12. *
  13. * @var array
  14. */
  15. protected $commands = [
  16. Apollo::class,
  17. PostYesterday::class,
  18. Downloads::class
  19. ];
  20. /**
  21. * Define the application's command schedule.
  22. *
  23. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  24. * @return void
  25. */
  26. protected function schedule(Schedule $schedule)
  27. {
  28. $path = storage_path('logs/'.date('Y-m-d').'-schedule.log');
  29. $schedule->command('download:download')
  30. ->everyMinute()
  31. ->withoutOverlapping()->appendOutputTo($path);
  32. $schedule->command('post:yesterday')
  33. ->dailyAt('23:50')
  34. ->withoutOverlapping()->appendOutputTo($path);
  35. }
  36. }