Kernel.php 1.7 KB

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