Horizon: [Question] Where should failed job be stored at?

Created on 10 Aug 2017  路  3Comments  路  Source: laravel/horizon

Hi,

I'm testing around with horizon with a new Laravel 5.5 app.
I created a Job that throws an Exception after a second to emulate a failing job.

The only settings I have changed are queue and broadcast driver to redis. But when queue the job, I always get another Exception too:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'jarvis.failed_jobs' doesn't exist (SQL: insert into `failed_jobs` (`connection`, `queue`, `payload`, `exception`, `failed_at`)...

I know I can create this table with artisan, but my question is: Should the jobs be stored in both? the failed_jobs table and the redis? Or am I missing a configuration? There is only one implemented JobRepository https://github.com/laravel/horizon/blob/9ab7c9fd041674f48a47049a5a88350586c7fbb0/src/Repositories/RedisJobRepository.php I could found. That makes me completely baffled -.-.

Thank you.

Most helpful comment

The store on the database is permanent, the one on Redis is temporary, we flush it every few days not to eat all the server memory. So yes you need to create that table to store failed jobs.

All 3 comments

The store on the database is permanent, the one on Redis is temporary, we flush it every few days not to eat all the server memory. So yes you need to create that table to store failed jobs.

Thank you @themsaid

@themsaid when it clear the failed jobs on redis, will this remove those from the database as well?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tillkruss picture tillkruss  路  6Comments

RicardoRamirezR picture RicardoRamirezR  路  3Comments

mikeminckler picture mikeminckler  路  3Comments

etiennellipse picture etiennellipse  路  3Comments

rossuhms picture rossuhms  路  5Comments