Skip to content

Commit

Permalink
Add retry all button to failed jobs page in web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Haynes authored and defunkt committed Sep 2, 2011
1 parent 2113127 commit 0c00ad8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions lib/resque/server.rb
Expand Up @@ -176,6 +176,13 @@ def show_for_polling(page)
redirect u('failed')
end

post "/failed/requeue/all" do
Resque::Failure.count.times do |num|
Resque::Failure.requeue(num)
end
redirect u('failed')
end

get "/failed/requeue/:index" do
Resque::Failure.requeue(params[:index])
if request.xhr?
Expand Down
2 changes: 1 addition & 1 deletion lib/resque/server/public/style.css
Expand Up @@ -80,6 +80,6 @@ body { padding:0; margin:0; }
#main p.pagination a.less { float:left;}
#main p.pagination a.more { float:right;}

#main form {float:right; margin-top:-10px;}
#main form {float:right; margin-top:-10px;margin-left:10px;}

#main .time a.toggle_format {text-decoration:none;}
5 changes: 4 additions & 1 deletion lib/resque/server/views/failed.erb
Expand Up @@ -5,9 +5,12 @@

<h1>Failed Jobs</h1>
<%unless failed.empty?%>
<form method="POST" action="<%=u 'failed/clear'%>" class='clear-failed'>
<form method="POST" action="<%=u 'failed/clear'%>">
<input type='submit' name='' value='Clear Failed Jobs' />
</form>
<form method="POST" action="<%=u 'failed/requeue/all'%>">
<input type='submit' name='' value='Retry Failed Jobs' />
</form>
<%end%>
<p class='sub'>Showing <%=start%> to <%= start + 20 %> of <b><%= size = Resque::Failure.count %></b> jobs</p>
Expand Down

0 comments on commit 0c00ad8

Please sign in to comment.