Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Where should failed job be stored at? #88

Closed
okaufmann opened this issue Aug 10, 2017 · 4 comments
Closed

[Question] Where should failed job be stored at? #88

okaufmann opened this issue Aug 10, 2017 · 4 comments

Comments

@okaufmann
Copy link

okaufmann commented Aug 10, 2017

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.

@themsaid
Copy link
Member

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.

@okaufmann
Copy link
Author

Thank you @themsaid

@azrulamir
Copy link

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

@Alicia-Onion
Copy link

I have failed job in horizon but not in database, why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants