Pixelairport's avatar

Laravel queue should wait till the next job

Hi. I test my application with terminal and tinker. My job creates a db entry in a table called "track" if it is finished. It also checks at the beginning if there is a entry to avoid doing the same thing more than once in a set period. The problem i have is, that when I start the worker and push the dispatch event multiple times in a very short time, the job is done more than one time and I have 3 or 4 entries in track table, because it is done often. So it seems the jobs running parallel. Is there a workaround for this?

In my example i send an notification email to user with the number how many private messages he has. So the email should only be send every 14 days.

0 likes
1 reply
Pixelairport's avatar

I used

php artisan queue:work --queue="high"

first, which seems to do all things at once. When I use

php artisan queue:listen --queue="high"

it seems it first do one thing and then another. Is that correct?

Please or to participate in this conversation.