laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.83k stars 643 forks source link

Add redis.replicate_commands() to make purging of queue work #1389

Closed markieo1 closed 6 months ago

markieo1 commented 6 months ago

It is impossible to clear a queue using the horizon:clear artisan command. This is also seeen in issue #1068 The following exception is then thrown:

ERR Error running script (call to f_281c23c60c642d42fdedcc1acc8adc7317dd75a5): @user_script:18: @user_script: 18: Write commands not allowed after non deterministic commands. Call redis.replicate_commands() at the start of your script in order to switch to single commands replication mode.

This resolves the issue by adding the redis.replicate_commands() call in the Lua script.

github-actions[bot] commented 6 months ago

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

taylorotwell commented 6 months ago

This was removed in Redis 7:

CleanShot 2024-02-16 at 10 08 22@2x