Kernel.php 1.9 KB

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