seven 5 days ago
parent
commit
3945321ccc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Console/Kernel.php

+ 1 - 1
app/Console/Kernel.php

@@ -17,7 +17,7 @@ class Kernel extends ConsoleKernel
     {
         // $schedule->command('inspire')->hourly();
         $schedule->job(new FiveSecondTaskJob)
-             ->everyFiveSeconds()
+             ->cron('*/5 * * * * *') // 每秒的第0,5,10,15...秒执行
              ->withoutOverlapping() // 防止重复执行
              ->name('five-second-task') // 给任务起个名字
              ->onOneServer();       // 如果在多服务器环境