I am running into an issue since I switched to Redis for the queue in Laravel. I am dispatching jobs, but they arent always being picked up in the queue. I am testing this by dispatching the job in Tinker with a separate command line running php artisan queue:work and I am noticing sometimes I have to dispatch the job two or three times before it is being picked up by the queue.
Here is the job I am dispatching:
namespace AppJobs;
use AppEventsGameFunction;
use AppEventsGameUpdate;
use AppHttpLivewireGolfGame;
use AppModelsCards;
use AppModelsGames;
use AppModelsScores;
use AppModelsUser;
use IlluminateBusQueueable;
use IlluminateContractsQueueShouldBeUnique;
use IlluminateContractsQueueShouldQueue;
use IlluminateFoundationBusDispatchable;
use IlluminateQueueInteractsWithQueue;
use IlluminateQueueSerializesModels;
use IlluminateSupportFacadesLog;
use romanzippQueueMonitorTraitsIsMonitored;
class BotPlay implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
use IsMonitored;
I am calling it in tinker like this BotPlay::dispatch($game); and getting IlluminateFoundationBusPendingDispatch as a response each time.
Is there something I need to do differently with Redis when dispatching the job?
Thanks!
2
Answers
This was a mistake with my laravel setup and having two queues both picking up the jobs so they didn't always appear in the queue I was watching but were getting picked up in the other queue. With one queue it is working as expected.
Please check …
Have you started queue worker?
if not then start it by running below artisan command
Hope this will be helpful.