Issue
I try to run schedule on Laravel 5. Its work fine when I run this:
$schedule->call(function() {
// do something here..
})->everyMinute();
But when I add withoutOverlapping(), the scheduler never run the task:
$schedule->call(function () {
// do something here..
})->everyMinute()->name('job_name')->withoutOverlapping();
*these schedule code is written at /app/Console/Kernel.php
Solution
Delete ->everyMinute() when using ->withoutOverlapping() it will still run every minute but without overlapping.
UPDATE
Since Laravel v. 5.5+ you can specify on how many minutes must pass before the "without overlapping" lock expires.
eg. ->withoutOverlapping(10) can be used to unlock the "overlapping" when 10 minutes will pass.
Answered By - Vizjerei
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.