Sha256: b064d756a67a45f14f5ffd208f864915a47adbe9eb022a29712a1ba595a8993f

Contents?: true

Size: 1.71 KB

Versions: 4

Compression:

Stored size: 1.71 KB

Contents

<% @subtabs = resque.queues unless partial? || params[:id].nil? %>

<% if queue = params[:id] %>

  <h1>Pending jobs on <span class='hl'><%= queue %></span></h1>
  <form method="POST" action="<%=u "/queues/#{queue}/remove" %>" class='remove-queue'>
    <input type='submit' name='' value='Remove Queue' />
  </form>
  <p class='sub'>Showing <%= start = params[:start].to_i %> to <%= start + 20 %> of <b><%=size = resque.size(queue)%></b> jobs</p>
  <table class='jobs'>
    <tr>
      <th>Class</th>
      <th>Args</th>
    </tr>
    <% for job in (jobs = resque.peek(queue, start, 20)) %>
    <tr>
      <td class='class'><%= job['class'] %></td>
      <td class='args'><%=h job['args'].inspect %></td>
    </tr>
    <% end %>
    <% if jobs.empty? %>
    <tr>
      <td class='no-data' colspan='2'>There are no pending jobs in this queue</td>
    </tr>
    <% end %>
  </table>
  <%= partial :next_more, :start => start, :size => size %>
<% else %>

  <h1 class='wi'>Queues</h1>
  <p class='intro'>The list below contains all the registered queues with the number of jobs currently in the queue. Select a queue from above to view all jobs currently pending on the queue.</p>
  <table class='queues'>
    <tr>
      <th>Name</th>
      <th>Jobs</th>
    </tr>
    <% for queue in resque.queues.sort_by { |q| q.to_s } %>
    <tr>
      <td class='queue'><a class="queue" href="<%= u "queues/#{queue}" %>"><%= queue %></a></td>
      <td class='size'><%= resque.size queue %></td>
    </tr>
    <% end %>
    <tr class="<%= Resque::Failure.count.zero? ? "failed" : "failure" %>">
      <td class='queue failed'><a class="queue" href="<%= u :failed %>">failed</a></td>
      <td class='size'><%= Resque::Failure.count %></td>
    </tr>
  </table>

<% end %>

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
nfo-resque-mongo-1.15.1 lib/resque/server/views/queues.erb
nfo-resque-mongo-1.15.0 lib/resque/server/views/queues.erb
resque-1.15.0 lib/resque/server/views/queues.erb
resque-1.14.0 lib/resque/server/views/queues.erb