Kernel.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. use App\Jobs\FiveSecondTaskJob;
  6. class Kernel extends ConsoleKernel
  7. {
  8. protected $commands = [
  9. \App\Console\Commands\StartFiveSecondTask::class,
  10. ];
  11. /**
  12. * Define the application's command schedule.
  13. *
  14. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  15. * @return void
  16. */
  17. protected function schedule(Schedule $schedule)
  18. {
  19. // $schedule->command('inspire')->hourly();
  20. // $schedule->job(new FiveSecondTaskJob)
  21. // ->cron('*/5 * * * * *') // 每秒的第0,5,10,15...秒执行
  22. // ->withoutOverlapping() // 防止重复执行
  23. // ->name('five-second-task') // 给任务起个名字
  24. // ->onOneServer(); // 如果在多服务器环境
  25. $schedule->command('sport')->dailyAt('23:59:00');
  26. $schedule->command('rewards:auto-grant')->everyMinute()->withoutOverlapping(60);
  27. $schedule->command('messages:dispatch')->everyMinute()->withoutOverlapping(10);
  28. $schedule->command('reporting:sync')->everyMinute()->withoutOverlapping(30);
  29. $schedule->command('promotions:sync')->everyMinute()->withoutOverlapping(30);
  30. $schedule->command('third-game:sync-orders')
  31. ->everyMinute()
  32. ->withoutOverlapping(5);
  33. $schedule->command('third-game:backfill-commission --retry-missing')
  34. ->everyThirtyMinutes()
  35. ->withoutOverlapping(60);
  36. $schedule->command('agent:settle')
  37. ->dailyAt('04:10')
  38. ->withoutOverlapping(180);
  39. $schedule->command('share:sync-facts --write')->everyMinute()->withoutOverlapping(30);
  40. $schedule->command('agent:profit-sync')->everyMinute()->withoutOverlapping(30);
  41. $schedule->command('third-game:refresh-merchant-balance')->everyMinute()->withoutOverlapping(2)->runInBackground();
  42. $schedule->command('report:member-daily')->everyTenMinutes()->withoutOverlapping(30);
  43. $schedule->command('report:member-daily ' . now()->subDay()->toDateString() . ' --days=3')
  44. ->dailyAt('04:30')->withoutOverlapping(60);
  45. $schedule->command('rewards:sync-bases')->everyMinute()->withoutOverlapping(30);
  46. $schedule->command('wagering:sync')->everyMinute()->withoutOverlapping(30);
  47. $schedule->command('share:settle --reconcile')->everyFiveMinutes()->withoutOverlapping(120);
  48. $schedule->command('share:settle')->timezone('Asia/Shanghai')->dailyAt('00:10')->withoutOverlapping(180);
  49. $schedule->command('payment:pay-timeout')->everyMinute()->withoutOverlapping(10);
  50. // 模拟管理:推进自动任务(总开关关闭时立即退出);给 melbet 新建的游客补 user_type 标签
  51. $schedule->command('simulation:run')->everyMinute()->withoutOverlapping(5)->runInBackground();
  52. $schedule->command('users:sync-type')->everyMinute()->withoutOverlapping(5);
  53. $schedule->command('admin-realtime:prune')->hourly()->withoutOverlapping(30);
  54. }
  55. /**
  56. * Register the commands for the application.
  57. *
  58. * @return void
  59. */
  60. protected function commands()
  61. {
  62. $this->load(__DIR__.'/Commands');
  63. require base_path('routes/console.php');
  64. }
  65. }