Horizon: cache:clear will wipe jobs

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

As discussed with @themsaid, the cache:clear command calls FLUSHDB, which will delete all Horizon data, or other application data stored in Redis.

Most helpful comment

Hi @themsaid, I can't find it in the Horizon docs. Does it still need to be added?

All 6 comments

For now we'll just have to make sure your queues are persisted in a separate Redis connection.

Or suggest in the docs to use a different Redis connection for the cache.

We'll mention in the docs that it's recommended to use a separate redis connection for queues to avoid issues like this and also make sure other redis clients won't eat all the memory leaving your workers in a broken state.

Hi @themsaid, I can't find it in the Horizon docs. Does it still need to be added?

This seems like a pretty important thing to document. Is this still on the radar?

An easy solution to this problem would be to simply create duplicate connection with a different database index, as described here: https://stackoverflow.com/a/46869372/11568. Perhaps a similar solution could be documented in the official docs.

I put together a little package to handle clearing specific Redis queues. I'd be interested to know if this helps anyone https://github.com/kevindees/laravel-redis-queue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elynnaie picture elynnaie  路  3Comments

lasselehtinen picture lasselehtinen  路  3Comments

dmitryuk picture dmitryuk  路  3Comments

wturrell picture wturrell  路  5Comments

terryzwt picture terryzwt  路  6Comments