8000 Add button for deleting jobs from queue by h3nnn4n · Pull Request #1732 · resque/resque · GitHub
[go: up one dir, main page]

Skip to content

Add button for deleting jobs from queue#1732

Draft
h3nnn4n wants to merge 6 commits intoresque:masterfrom
h3nnn4n:add_button_for_deleting_jobs_from_queue
Draft

Add button for deleting jobs from queue#1732
h3nnn4n wants to merge 6 commits intoresque:masterfrom
h3nnn4n:add_button_for_deleting_jobs_from_queue

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 < 8000 span class="pl-c1">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.

4 participants

0