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 App\Jobs;
use App\Events\GameFunction;
use App\Events\GameUpdate;
use App\Http\Livewire\GolfGame;
use App\Models\Cards;
use App\Models\Games;
use App\Models\Scores;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use romanzipp\QueueMonitor\Traits\IsMonitored;
class BotPlay implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
use IsMonitored;
I am calling it in tinker like this BotPlay::dispatch($game); and getting Illuminate\Foundation\Bus\PendingDispatch as a response each time.
Is there something I need to do differently with Redis when dispatching the job?
Thanks!