Kernel.php 1.6 KB

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