Kernel.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\Apollo;
  4. use App\Console\Commands\BehaviorRecord;
  5. use App\Console\Commands\CalcPostWeight;
  6. use App\Console\Commands\ContentFeedCreate;
  7. use App\Console\Commands\ExcellentResidents;
  8. use App\Console\Commands\RankingList;
  9. use Illuminate\Console\Scheduling\Schedule;
  10. use Laravel\Lumen\Console\Kernel as ConsoleKernel;
  11. class Kernel extends ConsoleKernel
  12. {
  13. /**
  14. * The Artisan commands provided by your application.
  15. *
  16. * @var array
  17. */
  18. protected $commands = [
  19. Apollo::class,
  20. BehaviorRecord::class,
  21. CalcPostWeight::class,
  22. ContentFeedCreate::class,
  23. ExcellentResidents::class,
  24. RankingList::class
  25. ];
  26. /**
  27. * Define the application's command schedule.
  28. *
  29. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  30. * @return void
  31. */
  32. protected function schedule(Schedule $schedule)
  33. {
  34. $path = storage_path('logs/' . date('Y-m-d') . '-schedule.log');
  35. $schedule->command('post:calc_weight')
  36. ->everyFifteenMinutes()->withoutOverlapping()->appendOutputTo($path);
  37. $schedule->command('excellent:residents')
  38. ->dailyAt('00:05')
  39. ->withoutOverlapping()->appendOutputTo($path);
  40. $schedule->command('ranking:list')
  41. ->dailyAt('00:05')
  42. ->withoutOverlapping()->appendOutputTo($path);
  43. }
  44. }