As discussed with @themsaid, the cache:clear command calls FLUSHDB, which will delete all Horizon data, or other application data stored in Redis.
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
Most helpful comment
Hi @themsaid, I can't find it in the Horizon docs. Does it still need to be added?