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

Add "quiet" label to UI when process is quieted"

This commit is contained in:
Jarrod Carlson 2016-01-07 16:33:37 -05:00
parent ee8d958a6b
commit 0c6466ef10
3 changed files with 11 additions and 1 deletions

View file

@ -738,6 +738,10 @@ module Sidekiq
def dump_threads
signal('TTIN')
end
def stopping?
self['stopping']
end
private

View file

@ -128,6 +128,7 @@ module Sidekiq
'queues' => @options[:queues].uniq,
'labels' => @options[:labels],
'identity' => k,
'stopping' => @done
}
# this data doesn't change so dump it to a string
# now so we don't need to dump it every heartbeat.

View file

@ -30,6 +30,9 @@
<% process.labels.each do |label| %>
<span class="label label-info"><%= label %></span>
<% end %>
<% if process.stopping? %>
<span class="label label-danger">Quiet</span>
<% end %>
<br>
<b><%= "#{t('Queues')}: " %></b>
<%= process['queues'] * ", " %>
@ -42,7 +45,9 @@
<form method="POST">
<%= csrf_tag %>
<input type="hidden" name="identity" value="<%= process['identity'] %>"/>
<button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
<% unless process.stopping? %>
<button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
<% end %>
<button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
</form>
</div>