1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Show warning on Queues page if a queue is paused, fixes #1672

This commit is contained in:
Mike Perham 2014-04-24 22:16:34 -07:00
parent 0d7d84ff21
commit 809f0f3829
6 changed files with 14 additions and 0 deletions

View file

@ -1,6 +1,7 @@
HEAD
-----------
- Show warning on the Queues page if a queue is paused [#1672]
- Only activate the ActiveRecord middleware if ActiveRecord::Base is defined on boot. [#1666]
- Add ability to disable jobs going to the DJQ with the `dead` option.
```ruby

View file

@ -132,6 +132,11 @@ module Sidekiq
Sidekiq.redis { |con| con.llen(@rname) }
end
# Sidekiq Pro overrides this
def paused?
false
end
def latency
entry = Sidekiq.redis do |conn|
conn.lrange(@rname, -1, -1)

View file

@ -51,6 +51,7 @@ module Sidekiq
halt 404 unless params[:name]
@count = (params[:count] || 25).to_i
@name = params[:name]
@queue = Sidekiq::Queue.new(@name)
(@current_page, @total_size, @messages) = page("queue:#{@name}", params[:page], @count)
@messages = @messages.map {|msg| Sidekiq.load_json(msg) }
erb :queue

View file

@ -66,3 +66,4 @@ en: # <---- change this to your locale code
Thread: Thread
Threads: Threads
Jobs: Jobs
Paused: Paused

View file

@ -2,6 +2,9 @@
<div class="col-sm-5">
<h3>
<%= t('CurrentMessagesInQueue', :queue => @name) %>
<% if @queue.paused? %>
<span class="label label-danger"><%= t('Paused') %></span>
<% end %>
</h3>
</div>
<div class="col-sm-4 pull-right">

View file

@ -10,6 +10,9 @@
<tr>
<td>
<a href="<%= root_path %>queues/<%= queue.name %>"><%= queue.name %></a>
<% if queue.paused? %>
<span class="label label-danger"><%= t('Paused') %></span>
<% end %>
</td>
<td><%= number_with_delimiter(queue.size) %> </td>
<td width="20%">