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

[5.x] Add Horizon command to clear queue #892

Merged
merged 2 commits into from
Sep 22, 2020
Merged

[5.x] Add Horizon command to clear queue #892

merged 2 commits into from
Sep 22, 2020

Conversation

paras-malhotra
Copy link
Contributor

@paras-malhotra paras-malhotra commented Sep 22, 2020

Resubmission of #890

Adds a Horizon command to clear queues. The way this is different from the Framework's queue:clear command is that it also deletes the jobs from the recent_jobs and pending_jobs sorted sets and Horizon job hash.

Instead of looping through recent jobs in PHP, I've added a Lua script to do this in a more efficient manner. This is backwards-compatible as it checks if the RedisQueue class has the clear method, so it will show a user-friendly error message for Laravel versions prior to 8.4.

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

Successfully merging this pull request may close these issues.

2 participants