Kernel.php 999 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 Illuminate\Console\Scheduling\Schedule;
  8. use Laravel\Lumen\Console\Kernel as ConsoleKernel;
  9. class Kernel extends ConsoleKernel
  10. {
  11. /**
  12. * The Artisan commands provided by your application.
  13. *
  14. * @var array
  15. */
  16. protected $commands = [
  17. Apollo::class,
  18. BehaviorRecord::class,
  19. CalcPostWeight::class,
  20. ContentFeedCreate::class
  21. ];
  22. /**
  23. * Define the application's command schedule.
  24. *
  25. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  26. * @return void
  27. */
  28. protected function schedule(Schedule $schedule)
  29. {
  30. $path = storage_path('logs/'.date('Y-m-d').'-schedule.log');
  31. $schedule->command('post:calc_weight')
  32. ->everyFifteenMinutes()->withoutOverlapping()->appendOutputTo($path);
  33. }
  34. }