Skip to content

Commit

Permalink
Add "quiet" label to UI when process is quieted"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarrod Carlson committed Jan 7, 2016
1 parent ee8d958 commit 0c6466e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/sidekiq/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,10 @@ def stop!
def dump_threads
signal('TTIN')
end

def stopping?
self['stopping']
end

private

Expand Down
1 change: 1 addition & 0 deletions lib/sidekiq/launcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def start_heartbeat
'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.
Expand Down
7 changes: 6 additions & 1 deletion web/views/busy.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'] * ", " %>
Expand All @@ -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>
Expand Down

0 comments on commit 0c6466e

Please sign in to comment.