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

Add Kill All button to the retries page (#3938)

This commit is contained in:
Morad Edwar 2018-08-25 18:42:01 +04:00 committed by Mike Perham
parent e8227186bb
commit 305ab8eedc
5 changed files with 18 additions and 0 deletions

View file

@ -670,6 +670,12 @@ module Sidekiq
each(&:retry)
end
end
def kill_all
while size > 0
each(&:kill)
end
end
end
##

View file

@ -196,6 +196,12 @@ module Sidekiq
redirect "#{root_path}retries"
end
post "/retries/all/kill" do
Sidekiq::RetrySet.new.kill_all
redirect "#{root_path}retries"
end
post "/retries/:key" do
job = Sidekiq::RetrySet.new.fetch(*parse_params(route_params[:key])).first

View file

@ -40,6 +40,7 @@ ar:
AreYouSure: هل انت متأكد؟
DeleteAll: حذف الكل
RetryAll: إعادة المحاولة للكل
KillAll: إبطال الكل
NoRetriesFound: لاتوجد أي إعادة محاولة
Error: خطأ
ErrorClass: نوع الخطأ

View file

@ -39,6 +39,7 @@ en: # <---- change this to your locale code
AreYouSure: Are you sure?
DeleteAll: Delete All
RetryAll: Retry All
KillAll: Kill All
NoRetriesFound: No retries were found
Error: Error
ErrorClass: Error Class

View file

@ -69,6 +69,10 @@
<%= csrf_tag %>
<input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
</form>
<form action="<%= root_path %>retries/all/kill" method="post">
<%= csrf_tag %>
<input class="btn btn-danger btn-xs pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
</form>
<% end %>
<% else %>