Issue
In my Laravel Kernel I have the following schedule function:
$schedule->command('import:currencyrate')->everyMinute()->withoutOverlapping(1)->emailOutputOnFailure('contact@website.com');
$schedule->command('import:token_data')->everyFiveMinutes()->withoutOverlapping(1)->emailOutputOnFailure('contact@website.com');
$schedule->command('import:nft_data')->everyTenMinutes()->withoutOverlapping(1);
This usually works without any issues for the last year. But for the last few days, my server crashes 1-2 times a day, due to tasks that don't complete & overlap:
How is this possible? I use withoutOverlapping, shouldn't that stop the same task to run multiple times?
Solution
you have written ->withoutOverlapping(1)
that means after 1 min of lock time your task will run again. Click here to see the laravel documentation. Try ->withoutOverlapping()
and check.
Answered By - S_B Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.