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

Add button for deleting jobs from queue #1732

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

h3nnn4n
Copy link

@h3nnn4n h3nnn4n commented Oct 30, 2020

More than once I was required to either remove one pending job from Resque, or all jobs of a given class. For both cases I had to access the production server and run a custom script, which is not ideal. Based on that, this PR makes two changes:

  1. Adds a dropdown with the list of all job classes in a queue and a button that removes all jobs of the selected class from the queue.
  2. A button next to a pending job to delete that specific job

Here is a screenshot of how it looks:
Resque

Some notes:

  • To properly support ActiveJob jobs I had to add some checks to fetch the class from the payload
  • The button to remove a job will delete all jobs matching class and args. I could not find a better way to do this.

Comment on lines +2 to +3
<input id="job_class" name="job_class" type="hidden" value=<%=job['class']%> />
<input id="job_args" name="job_args" type="hidden" value=<%=job['args'].to_json%> />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<input id="job_class" name="job_class" type="hidden" value=<%=job['class']%> />
<input id="job_args" name="job_args" type="hidden" value=<%=job['args'].to_json%> />
<input id="job_class" name="job_class" type="hidden" value=<%= job['class'] %> />
<input id="job_args" name="job_args" type="hidden" value=<%= job['args'].to_json %> />

@matthewhively
Copy link
Contributor

It would be nice to have this feature.

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.

None yet

4 participants