Skip to content

Commit

Permalink
add a clear delayed jobs button to the delayed jobs page
Browse files Browse the repository at this point in the history
  • Loading branch information
john-griffin committed Jul 13, 2011
1 parent 4a9ba17 commit c183b0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/resque_scheduler/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def queue_from_class_name(class_name)
Resque::Scheduler.enqueue_delayed_items_for_timestamp(timestamp.to_i) if timestamp.to_i > 0
redirect u("/overview")
end

post "/delayed/clear" do
Resque.reset_delayed_queue
redirect u('delayed')
end

end

Expand Down
8 changes: 7 additions & 1 deletion lib/resque_scheduler/server/views/delayed.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<h1>Delayed Jobs</h1>
<%- size = resque.delayed_queue_schedule_size %>
<% if size > 0 %>
<form method="POST" action="<%=u 'delayed/clear'%>" class='clear-delayed'>
<input type='submit' name='' value='Clear Delayed Jobs' />
</form>
<% end %>

<p class='intro'>
This list below contains the timestamps for scheduled delayed jobs.
</p>

<p class='sub'>
Showing <%= start = params[:start].to_i %> to <%= start + 20 %> of <b><%=size = resque.delayed_queue_schedule_size %></b> timestamps
Showing <%= start = params[:start].to_i %> to <%= start + 20 %> of <b><%= size %></b> timestamps
</p>

<table>
Expand Down

0 comments on commit c183b0d

Please sign in to comment.