Pankaj
Pankaj

Reputation: 10095

Increase decrease polling time of pending jobs in Laravel 5.4

I am trying to implement the queues on localhost in Laravel 5.4. I have Window 8.1

I have opened command prompt and found that the framework is continuously polling the jobs table to check if there is any pending job in queue. This process is happening after each 3 seconds.

Question: Is there any way to increase decrease the time?

Upvotes: 0

Views: 810

Answers (1)

Foo
Foo

Reputation: 576

You should be able to change it using the artisan command:

php artisan queue:work --sleep=3

Change the number 3 to whatever you want, in seconds. Sleep only applies when there are no jobs in the queue. If there are jobs in the queue, it pops them off without sleeping.

See this page for more options that you can configure:

https://laravel.com/docs/5.4/queues#running-the-queue-worker

Upvotes: 2

Related Questions