Support the ongoing development of Laravel.io →
posted 4 years ago
Queues Jobs
Last updated 2 years ago.
0

The withoutOverlapping() method is meant to not run multiple times on the same item.

So if new FooJob(1) is set to run every 5 minutes and it takes 7 minutes, the second run of the scheduler will not run. Basically it checks to see if this one is still running, if so, return.

With your setup right now, all 3 jobs will run every 5 minutes unless one takes longer and then that specific one will not run while the others will continue to run.

Hope that helps.

0

Hi Ben! thanks for the reply!

What i would like to know is: 1.) Does "withoutOverlapping" method exist for Jobs? 2.) if FooJob(1) is being execution time is 7minutes and FooJob(2) is trying to be executed, will it get be executed? 3.) Have you tried the Jobs Scheduler using withoutOverlapping method and ran same Job with different argument?

thanks!

0
  1. AFAIK the withoutOverlapping only applies to the scheduler.
  2. If they are separate lines inside the scheduler then, AFAIK, yes, it will run.
  3. I have not. I prefer to be specific with jobs (even if they do mostly the same thing). i.e. If FooJob(1) is really DoSomethingToUsersWithRole($role), then make DoSomethingToBasicUsers() and DoSomethingToAdminUsers() jobs and let them live separately. This will help when something inevitably changes with one of the logic paths.

Here's a deep dive on how withoutOverlapping works: https://divinglaravel.com/preventing-scheduled-jobs-overlapping

0

Hi Ben. thanks for sharing your idea. really appreciate your help to give you a glimpse of what i am doing. i am working on an SaaS application. thats FooJob($user_id) and its doing a heftic job. before, I have all users run in one job only(Native PHP) but since its a heftic task (most likely composed of API sends/receives hundreds/thousands of information each user) I am experiencing some execution time and Mysql going away errors. I love the idea of Job Queues of laravel where you can dispatch each job instance on their own threads.. thus i can dispatch separate job threads for each user which makes processing faster and less execution time. i wonder if you have experienced the same thing thats why i am more inclined on dispatching a separate instance of jobs.

0

It is undisputed that Statistics Assignment Help Services pose challenges for students because preparation takes into consideration a lot of details needed for Statistics Writing Services and in-depth knowledge on the topic in order to come up with a Custom Statistics Coursework Writing Service. https://www.meldaresearch.com/statistics-assignment-help-service/

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.