DEV Community

Antonios Thanasis
Antonios Thanasis

Posted on

My queue runs in sync mode even though .env has QUEUE_CONNECTION=database

Sometimes when working with jobs and queues in Laravel, you may run into an issue where you change your queue connection from sync to database, but your jobs still run synchronously β€” or nothing works as expected.

In many cases, this happens because of Laravel’s configuration caching system.

Even though you updated your .env file:

QUEUE_CONNECTION=database

Laravel may still be using the cached configuration.

βœ… Solution:

Simply run the following commands:

php artisan config:clear
php artisan queue:restart

This clears the cached configuration and restarts the queue workers so the changes take effect.

After that, your queue should correctly use the database driver.

Happy coding! πŸš€

Top comments (0)