abkrim
abkrim

Reputation: 3692

Queues run X next jobs on queue of Laravel

I'm looking information about run X next jobs on queue of Laravel.

On my app, only can run 10 on some queue (name_of_any_queue) per minute.

On doc only see this:

php artisan queue:work --queue=name_of_any_queue --once   Only process the next job on the queue

But this only run next job.

I've a task for running every minute command above.

It's possible? How can I do?

Upvotes: 0

Views: 266

Answers (1)

Ohgodwhy
Ohgodwhy

Reputation: 50787

Two problems:

  1. You cannot pass an argument to the queue to dictate how many items to process, other than one.
  2. You cannot set a cron task to run less every minute.

Solution:

Use a loop and process --once 8 times within the loop.

Upvotes: 2

Related Questions