Permalink
Browse files

Added the option to change the per_page option

* Now you can call ?per_page in the query string for better paging in the failed queue
* Added documentation
  • Loading branch information...
1 parent 7024f42 commit 323c2ced68e7185d878238ef25114f42ae085585 @KensoDev KensoDev committed Sep 19, 2011
Showing with 21 additions and 6 deletions.
  1. +15 −0 README.md
  2. +5 −5 lib/resque/server/views/failed.erb
  3. +1 −1 lib/resque/server/views/next_more.erb
View
@@ -58,6 +58,7 @@ Table Of Contents
* [Mysql::Error: MySQL server has gone away](#section_Workers_Mysql_Error_MySQL_server_has_gone_away)
* [The Front End](#section_The_Front_End)
* [Standalone](#section_The_Front_End_Standalone)
+ * [Using the front end for failure review](#section_Using_The_Front_End_For_Review)
* [Passenger](#section_The_Front_End_Passenger)
* [Rack::URLMap](#section_The_Front_End_Rack_URLMap)
* [Rails 3](#section_The_Front_End_Rails_3)
@@ -535,7 +536,21 @@ or set the Redis connection string if you need to do something like select a dif
$ resque-web -p 8282 -r localhost:6379:2
+<a name='section_Using_The_Front_End_For_Review'></a>
+
+### Using The front end for failures review
+
+Using the front end to review what's happening in the queue
+-----------------------------------------------------------
+After using Resque for a while, you may have quite a few failed jobs.
+Reviewing them by going over pages when showing 20 a page can be a bit hard.
+
+You can change the param in the url (in the failed view only for now), just add per_page=100 and you will see 100 per page.
+for example: http://www.your_domain.com/resque/failed?start=20&per_page=200.
+
+
<a name='section_The_Front_End_Passenger'></a>
+
### Passenger
Using Passenger? Resque ships with a `config.ru` you can use. See
@@ -1,5 +1,6 @@
-<%start = params[:start].to_i %>
-<%failed = Resque::Failure.all(start, 20)%>
+<% start = params[:start].to_i %>
+<% per_page = (params[:per_page].to_i > 0) ? params[:per_page].to_i : 20 %>
+<% failed = Resque::Failure.all(start, per_page) %>
<% index = 0 %>
<% date_format = "%Y/%m/%d %T %z" %>
@@ -13,7 +14,7 @@
</form>
<%end%>
-<p class='sub'>Showing <%=start%> to <%= start + 20 %> of <b><%= size = Resque::Failure.count %></b> jobs</p>
+<p class='sub'>Showing <%=start%> to <%= start + per_page %> of <b><%= size = Resque::Failure.count %></b> jobs</p>
<ul class='failed'>
<%for job in failed%>
@@ -63,5 +64,4 @@
<%end%>
</ul>
-<%= partial :next_more, :start => start, :size => size %>
-
+<%= partial :next_more, :start => start, :size => size, :per_page => per_page %>
@@ -1,4 +1,4 @@
-<%if start - 20 >= 0 || start + 20 <= size%>
+<% if start - 20 >= 0 || start + 20 <= size %>
<p class='pagination'>
<% if start - 20 >= 0 %>
<a href="<%= current_page %>?start=<%= start - 20 %>" class='less'>&laquo; less</a>

0 comments on commit 323c2ce

Please sign in to comment.