S
S
suhuxa12017-10-13 21:03:39
Laravel
suhuxa1, 2017-10-13 21:03:39

Is it possible to use laravel's withoutOverlapping method along with time?

Good evening!
Everywhere I see that you can use the withoutOverlapping method to prevent a process from starting if the previous one is already running:

$schedule->command('emails:send')->withoutOverlapping();

But nowhere does it say whether it can be used in such a context:
$schedule->command('emails:send')->everyMinute()->withoutOverlapping();

Those. with an indication of when to start?
And another question, too, on the topic. As I understand it, this method should prevent the current task from starting if the same task is already running. Is there a method that will prevent the current task from running if any of the tasks in the cron is already running? The server is weak, it runs about 5 cron commands, and it happens that one overlaps with another, and the server starts to slow down more and more.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Misty Hedgehog, 2017-10-14
@paramtamtam

Perhaps it makes sense for you to get away from using cron in principle, looking towards the queue (+ horizon, optional)?
Such a solution will turn out to be horizontally scalable, and (really) not so complicated and "terrible" to implement :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question