Kernel.php 1.5 KB

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