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:forget command to delete a failed job #896

Merged
merged 1 commit into from
Sep 24, 2020
Merged

[5.x] Add horizon:forget command to delete a failed job #896

merged 1 commit into from
Sep 24, 2020

Conversation

paras-malhotra
Copy link
Contributor

Currently, there's no way to delete a failed job from both Redis and the database. The queue:forget command in the framework simply deletes the job from the database but the Horizon dashboard still shows the job as failed.

This PR provides a clean way for users using Horizon to delete failed jobs.

@driesvints
Copy link
Member

Wondering if we can make this a bit more generic as a ForgetCommand that can delete any job but has flags like --failed to specifically delete failed jobs. Does that even makes sense?

@paras-malhotra
Copy link
Contributor Author

paras-malhotra commented Sep 24, 2020

@driesvints I wanted to make it mirror the queue:forget like we have horizon:clear and queue:clear.

Also, there's no way to delete a pending job using the Framework. The delete function on the Job class just deletes reserved jobs and doesn't work for pending jobs. I guess this hasn't been added to the framework as it would be very inefficient for queues like Redis that either need a full scan operation or would need to reconstruct the original job json payload.

@driesvints
Copy link
Member

@paras-malhotra gotcha. Makes sense 👍

@taylorotwell taylorotwell merged commit c06e066 into laravel:5.x Sep 24, 2020
@paras-malhotra paras-malhotra deleted the forget_failed branch September 24, 2020 13:20
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.

3 participants