Why jobs table are empty when dispatching a job in Laravel 6?

Viewed 2354

I'm using laravel 6

I've been struggling all the day to figure out why jobs table never get populated when I dispatch a job

When I hit this artisan command php artisan queue:work

I get the following

[2020-04-08 11:37:04][12] Processing: App\Jobs\SendEmail
[2020-04-08 11:37:05][12] Processed:  App\Jobs\SendEmail
[2020-04-08 11:37:05][13] Processing: App\Mail\ActivationEmail
[2020-04-08 11:37:06][13] Processed:  App\Mail\ActivationEmail

Email get sent successfuly..

I changed some configurations in config.php

 'default' => env('QUEUE_CONNECTION', 'database'),

as well as .env

QUEUE_CONNECTION=database

failed_jobs and jobs tables are migrated..

jobs table always empty...

why this is happening ?

2 Answers

Because jobs processed successfully and run immediately,

if you set delay you can see it in the jobs table or if you have an exception while running jobs, you can see it in the failed_jobs table.

Assuming you're queueing new jobs in code, have you run php artisan config:clear? It's possible that your config settings have been cached; changing the env file if they are won't have any effect until you've cleared the config cache.

Related