Skip to content
Advertisement

Laravel Redis Jobs are not Being Queued

I am using Laravel with Phpredis and I’ve created a webhook that adds a job to the queue. I’ve followed the docs for the interrogation but my jobs are not being queued.

.env

QUEUE_CONNECTION=redis

config/database.php

'client' => env('REDIS_CLIENT', 'phpredis'),

config/queue.php

...
'connections' => [
    ...
    'redis' => [
        'driver' => 'redis',
        'connection' => 'default',
        'queue' => env('REDIS_QUEUE', 'default'),
        'retry_after' => 90,
        'block_for' => null,
     ],
    ...
],
...

I am using Windows with Xampp and redis-server.exe is running. This is what I am getting when the job is being added to the queue:

[9672] 03 Nov 21:44:03 - Accepted 127.0.0.1:52945
[9672] 03 Nov 21:44:03 - Client closed connection

This is how I’m adding the jobs to queue:

ProcessPhotos::dispatch($settings, $data, $id);

And this is how I’m trying to run the queued jobs:

php artisan queue:work
or
php artisan queue:listen

I am running one of the previous commands and nothing is happening and I’m also not receiving any errors. It’s like the queue is empty (I’ve also checked the queue length using this code and I’ve got 000).

I’ve also tried to set a key into redis and that seemed to work. Does somebody know what’s happening? I’m thinking to move to database if i can’t get this solved …

Advertisement

Answer

I’ve fixed the issue!

It turned out that it was something wrong with the server. (I’ve reinstalled again the Redis extension and it still wasn’t working, then I changed the server version and it was working)

I reinstalled the Redis extension from here and switched to this server version. The rest of the settings were the same as in my previous post.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement