1
votes

So I am just starting out with laravel queues. I have a job that is just logging something for me to see. The queue driver is database.

The job runs,But the queue does not add any db entries.

I have so far tried

stopping the server after a delayed job is added -> php artisan config:clear -> php artisan config:cache -> restarting before the job runs

The job runs fine, but I can see no entries in the jobs table

What could be missing here?

here are the connections from queue.php

'connections' => [

    'sync' => [
        'driver' => 'sync',
    ],

    'database' => [
        'driver' => 'database',
        'table' => 'jobs',
        'queue' => 'default',
        'retry_after' => 90,
    ]

]

1
The jobs table lists all your queued jobs. You aren't seeing any jobs in the table because they have already executed successfully like you said. Once a job runs successfully it is removed from the jobs table in the database.Nathan

1 Answers

0
votes

The jobs table is not there for you to know which jobs ran, it is there to be a place where the workers can pick up jobs from. If it fails, it will be put into failed_jobs.

To get an overview of which jobs is running, Laravel developers often choose the Laravel queue package Horizon (which is a wrapper for a redis driver). This requires redis, which can be hard to setup but the dashboard feature it comes with is a great tool.

enter image description here