the timing of Laravel scheduled task execution is uncertain. I added withoutOverlapping ()
according to the document, but it doesn"t seem to take effect
.
Development environment: windows 10, laradock, Laravel 5.4.36
related codes
Code of kernel
$schedule- > command ("produce:email")-> withoutOverlapping ();
Code of the command
public function handle()
{
$name = mt_rand(10000,99999);
Log::info($name . ":".date("Y-m-d H:i:s"));
$this->parseAppName();
$this->createQueue();
arsort($this->queue);
if(count($this->queue) <= 0){
return ;
}
foreach ($this->queue as $key => $queue) {
$this->getHistoryId($key,$queue["filter"]);
$this->executeAdd($key,$queue);
}
Log::info($name .":".date("Y-m-d H:i:s"));
}
the output log file is as follows: 80781 before the end of the task, the system opened 8 new tasks
[2018-07-10 03:23:18] local.INFO: 80781:2018-07-10 03:23:18
[2018-07-10 03:24:07] local.INFO: 91189:2018-07-10 03:24:07
[2018-07-10 03:25:05] local.INFO: 73828:2018-07-10 03:25:05
[2018-07-10 03:26:09] local.INFO: 96934:2018-07-10 03:26:09
[2018-07-10 03:27:06] local.INFO: 79930:2018-07-10 03:27:06
[2018-07-10 03:28:13] local.INFO: 39674:2018-07-10 03:28:13
[2018-07-10 03:29:06] local.INFO: 44935:2018-07-10 03:29:06
[2018-07-10 03:30:16] local.INFO: 40087:2018-07-10 03:30:16
[2018-07-10 03:31:05] local.INFO: 42935:2018-07-10 03:31:05
[2018-07-10 03:31:26] local.INFO: 91189:2018-07-10 03:31:26
[2018-07-10 03:31:26] local.INFO: 80781:2018-07-10 03:31:26