sidekiq 6.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

Files changed (127) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +71 -0
  3. data/.github/contributing.md +32 -0
  4. data/.github/issue_template.md +11 -0
  5. data/.gitignore +13 -0
  6. data/.standard.yml +20 -0
  7. data/3.0-Upgrade.md +70 -0
  8. data/4.0-Upgrade.md +53 -0
  9. data/5.0-Upgrade.md +56 -0
  10. data/6.0-Upgrade.md +72 -0
  11. data/COMM-LICENSE +97 -0
  12. data/Changes.md +1718 -0
  13. data/Ent-2.0-Upgrade.md +37 -0
  14. data/Ent-Changes.md +269 -0
  15. data/Gemfile +24 -0
  16. data/Gemfile.lock +208 -0
  17. data/LICENSE +9 -0
  18. data/Pro-2.0-Upgrade.md +138 -0
  19. data/Pro-3.0-Upgrade.md +44 -0
  20. data/Pro-4.0-Upgrade.md +35 -0
  21. data/Pro-5.0-Upgrade.md +25 -0
  22. data/Pro-Changes.md +790 -0
  23. data/README.md +94 -0
  24. data/Rakefile +10 -0
  25. data/bin/sidekiq +42 -0
  26. data/bin/sidekiqload +157 -0
  27. data/bin/sidekiqmon +8 -0
  28. data/code_of_conduct.md +50 -0
  29. data/lib/generators/sidekiq/templates/worker.rb.erb +9 -0
  30. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +6 -0
  31. data/lib/generators/sidekiq/templates/worker_test.rb.erb +8 -0
  32. data/lib/generators/sidekiq/worker_generator.rb +57 -0
  33. data/lib/sidekiq.rb +262 -0
  34. data/lib/sidekiq/api.rb +960 -0
  35. data/lib/sidekiq/cli.rb +401 -0
  36. data/lib/sidekiq/client.rb +263 -0
  37. data/lib/sidekiq/delay.rb +41 -0
  38. data/lib/sidekiq/exception_handler.rb +27 -0
  39. data/lib/sidekiq/extensions/action_mailer.rb +47 -0
  40. data/lib/sidekiq/extensions/active_record.rb +43 -0
  41. data/lib/sidekiq/extensions/class_methods.rb +43 -0
  42. data/lib/sidekiq/extensions/generic_proxy.rb +31 -0
  43. data/lib/sidekiq/fetch.rb +82 -0
  44. data/lib/sidekiq/job_logger.rb +63 -0
  45. data/lib/sidekiq/job_retry.rb +262 -0
  46. data/lib/sidekiq/launcher.rb +206 -0
  47. data/lib/sidekiq/logger.rb +165 -0
  48. data/lib/sidekiq/manager.rb +135 -0
  49. data/lib/sidekiq/middleware/chain.rb +160 -0
  50. data/lib/sidekiq/middleware/i18n.rb +40 -0
  51. data/lib/sidekiq/monitor.rb +133 -0
  52. data/lib/sidekiq/paginator.rb +47 -0
  53. data/lib/sidekiq/processor.rb +280 -0
  54. data/lib/sidekiq/rails.rb +50 -0
  55. data/lib/sidekiq/redis_connection.rb +146 -0
  56. data/lib/sidekiq/scheduled.rb +173 -0
  57. data/lib/sidekiq/sd_notify.rb +149 -0
  58. data/lib/sidekiq/systemd.rb +24 -0
  59. data/lib/sidekiq/testing.rb +344 -0
  60. data/lib/sidekiq/testing/inline.rb +30 -0
  61. data/lib/sidekiq/util.rb +67 -0
  62. data/lib/sidekiq/version.rb +5 -0
  63. data/lib/sidekiq/web.rb +213 -0
  64. data/lib/sidekiq/web/action.rb +93 -0
  65. data/lib/sidekiq/web/application.rb +357 -0
  66. data/lib/sidekiq/web/csrf_protection.rb +153 -0
  67. data/lib/sidekiq/web/helpers.rb +333 -0
  68. data/lib/sidekiq/web/router.rb +101 -0
  69. data/lib/sidekiq/worker.rb +244 -0
  70. data/sidekiq.gemspec +20 -0
  71. data/web/assets/images/favicon.ico +0 -0
  72. data/web/assets/images/logo.png +0 -0
  73. data/web/assets/images/status.png +0 -0
  74. data/web/assets/javascripts/application.js +95 -0
  75. data/web/assets/javascripts/dashboard.js +296 -0
  76. data/web/assets/stylesheets/application-dark.css +133 -0
  77. data/web/assets/stylesheets/application-rtl.css +246 -0
  78. data/web/assets/stylesheets/application.css +1158 -0
  79. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  80. data/web/assets/stylesheets/bootstrap.css +5 -0
  81. data/web/locales/ar.yml +81 -0
  82. data/web/locales/cs.yml +78 -0
  83. data/web/locales/da.yml +68 -0
  84. data/web/locales/de.yml +81 -0
  85. data/web/locales/el.yml +68 -0
  86. data/web/locales/en.yml +83 -0
  87. data/web/locales/es.yml +70 -0
  88. data/web/locales/fa.yml +80 -0
  89. data/web/locales/fr.yml +78 -0
  90. data/web/locales/he.yml +79 -0
  91. data/web/locales/hi.yml +75 -0
  92. data/web/locales/it.yml +69 -0
  93. data/web/locales/ja.yml +83 -0
  94. data/web/locales/ko.yml +68 -0
  95. data/web/locales/lt.yml +83 -0
  96. data/web/locales/nb.yml +77 -0
  97. data/web/locales/nl.yml +68 -0
  98. data/web/locales/pl.yml +59 -0
  99. data/web/locales/pt-br.yml +68 -0
  100. data/web/locales/pt.yml +67 -0
  101. data/web/locales/ru.yml +78 -0
  102. data/web/locales/sv.yml +68 -0
  103. data/web/locales/ta.yml +75 -0
  104. data/web/locales/uk.yml +76 -0
  105. data/web/locales/ur.yml +80 -0
  106. data/web/locales/vi.yml +83 -0
  107. data/web/locales/zh-cn.yml +68 -0
  108. data/web/locales/zh-tw.yml +68 -0
  109. data/web/views/_footer.erb +20 -0
  110. data/web/views/_job_info.erb +89 -0
  111. data/web/views/_nav.erb +52 -0
  112. data/web/views/_paging.erb +23 -0
  113. data/web/views/_poll_link.erb +7 -0
  114. data/web/views/_status.erb +4 -0
  115. data/web/views/_summary.erb +40 -0
  116. data/web/views/busy.erb +101 -0
  117. data/web/views/dashboard.erb +75 -0
  118. data/web/views/dead.erb +34 -0
  119. data/web/views/layout.erb +41 -0
  120. data/web/views/morgue.erb +78 -0
  121. data/web/views/queue.erb +55 -0
  122. data/web/views/queues.erb +38 -0
  123. data/web/views/retries.erb +83 -0
  124. data/web/views/retry.erb +34 -0
  125. data/web/views/scheduled.erb +57 -0
  126. data/web/views/scheduled_job_info.erb +8 -0
  127. metadata +212 -0
@@ -0,0 +1,101 @@
1
+ <div class="row header">
2
+ <div class="col-sm-8 pull-left flip">
3
+ <h3><%= t('Processes') %></h3>
4
+ </div>
5
+ <div class="col-sm-4 pull-right flip">
6
+ <form method="POST" class="warning-messages">
7
+ <%= csrf_tag %>
8
+ <div class="btn-group pull-right flip">
9
+ <button class="btn btn-warn" type="submit" name="quiet" value="1" data-confirm="<%= t('AreYouSure') %>"><%= t('QuietAll') %></button>
10
+ <button class="btn btn-danger" type="submit" name="stop" value="1" data-confirm="<%= t('AreYouSure') %>"><%= t('StopAll') %></button>
11
+ </div>
12
+ </form>
13
+ </div>
14
+ </div>
15
+
16
+ <div class="table_container">
17
+ <table class="processes table table-hover table-bordered table-striped table-white">
18
+ <thead>
19
+ <th><%= t('Name') %></th>
20
+ <th><%= t('Started') %></th>
21
+ <th><%= t('Threads') %></th>
22
+ <th><%= t('Busy') %></th>
23
+ <th>&nbsp;</th>
24
+ </thead>
25
+ <% lead = processes.leader %>
26
+ <% processes.each do |process| %>
27
+ <tr>
28
+ <td class="box">
29
+ <%= "#{process['hostname']}:#{process['pid']}" %>
30
+ <span class="label label-success"><%= process.tag %></span>
31
+ <% process.labels.each do |label| %>
32
+ <span class="label label-info"><%= label %></span>
33
+ <% end %>
34
+ <% if process.stopping? %>
35
+ <span class="label label-danger">quiet</span>
36
+ <% end %>
37
+ <% if process.identity == lead %>
38
+ <span class="label label-warning">leader</span>
39
+ <% end %>
40
+ <br>
41
+ <b><%= "#{t('Queues')}: " %></b>
42
+ <%= process['queues'] * ", " %>
43
+ </td>
44
+ <td><%= relative_time(Time.at(process['started_at'])) %></td>
45
+ <td><%= process['concurrency'] %></td>
46
+ <td><%= process['busy'] %></td>
47
+ <td>
48
+ <div class="btn-group pull-right flip">
49
+ <form method="POST">
50
+ <%= csrf_tag %>
51
+ <input type="hidden" name="identity" value="<%= process['identity'] %>"/>
52
+ <% unless process.stopping? %>
53
+ <button class="btn btn-warn" type="submit" name="quiet" value="1"><%= t('Quiet') %></button>
54
+ <% end %>
55
+ <button class="btn btn-danger" type="submit" name="stop" value="1"><%= t('Stop') %></button>
56
+ </form>
57
+ </div>
58
+ </td>
59
+ </tr>
60
+ <% end %>
61
+ </table>
62
+ </div>
63
+
64
+ <div class="row header">
65
+ <div class="col-sm-7">
66
+ <h3><%= t('Jobs') %></h3>
67
+ </div>
68
+ </div>
69
+
70
+ <div class="table_container">
71
+ <table class="workers table table-hover table-bordered table-striped table-white">
72
+ <thead>
73
+ <th><%= t('Process') %></th>
74
+ <th><%= t('TID') %></th>
75
+ <th><%= t('JID') %></th>
76
+ <th><%= t('Queue') %></th>
77
+ <th><%= t('Job') %></th>
78
+ <th><%= t('Arguments') %></th>
79
+ <th><%= t('Started') %></th>
80
+ </thead>
81
+ <% workers.each do |process, thread, msg| %>
82
+ <% job = Sidekiq::Job.new(msg['payload']) %>
83
+ <tr>
84
+ <td><%= process %></td>
85
+ <td><%= thread %></td>
86
+ <td><%= job.jid %></td>
87
+ <td>
88
+ <a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
89
+ </td>
90
+ <td>
91
+ <%= job.display_class %>
92
+ <%= display_tags(job, nil) %>
93
+ </td>
94
+ <td>
95
+ <div class="args"><%= display_args(job.display_args) %></div>
96
+ </td>
97
+ <td><%= relative_time(Time.at(msg['run_at'])) %></td>
98
+ </tr>
99
+ <% end %>
100
+ </table>
101
+ </div>
@@ -0,0 +1,75 @@
1
+ <script type="text/javascript" src="<%= root_path %>javascripts/dashboard.js"></script>
2
+ <div class= "dashboard clearfix">
3
+ <h3 >
4
+ <%= t('Dashboard') %>
5
+ <span class="beacon">
6
+ <span class="ring"></span>
7
+ <span class="dot"></span>
8
+ </span>
9
+ </h3>
10
+ <div class="interval-slider ltr">
11
+ <span class="interval-slider-label"><%= t('PollingInterval') %>:</span>
12
+ <span class="current-interval">5 sec</span>
13
+ <br/>
14
+ <input type="range" min="2000" max="20000" step="1000" value="5000"/>
15
+ </div>
16
+ </div>
17
+
18
+ <div class="row chart">
19
+ <div id="realtime" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>"></div>
20
+ <div id="realtime-legend"></div>
21
+ </div>
22
+
23
+ <div class="row chart">
24
+ <h5>
25
+ <span class="history-heading"><%= t('History') %></span>
26
+ <a href="<%= root_path %>?days=7" class="history-graph <%= "active" if params[:days] == "7" %>"><%= t('OneWeek') %></a>
27
+ <a href="<%= root_path %>" class="history-graph <%= "active" if params[:days].nil? || params[:days] == "30" %>"><%= t('OneMonth') %></a>
28
+ <a href="<%= root_path %>?days=90" class="history-graph <%= "active" if params[:days] == "90" %>"><%= t('ThreeMonths') %></a>
29
+ <a href="<%= root_path %>?days=180" class="history-graph <%= "active" if params[:days] == "180" %>"><%= t('SixMonths') %></a>
30
+ </h5>
31
+
32
+ <div id="history" data-processed-label="<%= t('Processed') %>" data-failed-label="<%= t('Failed') %>" data-processed="<%= h Sidekiq.dump_json(@processed_history) %>" data-failed="<%= h Sidekiq.dump_json(@failed_history) %>" data-update-url="<%= root_path %>stats"></div>
33
+ <div id="history-legend"></div>
34
+ </div>
35
+
36
+ <br/>
37
+ <h5>Redis</h5>
38
+ <div class="redis-wrapper">
39
+ <div class="stats-container">
40
+ <% if @redis_info.fetch("redis_version", nil) %>
41
+ <div class="stat">
42
+ <h3 class="redis_version"><%= @redis_info.fetch("redis_version") %></h3>
43
+ <p><%= t('Version') %></p>
44
+ </div>
45
+ <% end %>
46
+
47
+ <% if @redis_info.fetch("uptime_in_days", nil) %>
48
+ <div class="stat">
49
+ <h3 class="uptime_in_days"><%= @redis_info.fetch("uptime_in_days") %></h3>
50
+ <p><%= t('Uptime') %></p>
51
+ </div>
52
+ <% end %>
53
+
54
+ <% if @redis_info.fetch("connected_clients", nil) %>
55
+ <div class="stat">
56
+ <h3 class="connected_clients"><%= @redis_info.fetch("connected_clients") %></h3>
57
+ <p><%= t('Connections') %></p>
58
+ </div>
59
+ <% end %>
60
+
61
+ <% if @redis_info.fetch("used_memory_human", nil) %>
62
+ <div class="stat">
63
+ <h3 class="used_memory_human"><%= @redis_info.fetch("used_memory_human") %></h3>
64
+ <p><%= t('MemoryUsage') %></p>
65
+ </div>
66
+ <% end %>
67
+
68
+ <% if @redis_info.fetch("used_memory_peak_human", nil) %>
69
+ <div class="stat">
70
+ <h3 class="used_memory_peak_human"><%= @redis_info.fetch("used_memory_peak_human") %></h3>
71
+ <p><%= t('PeakMemoryUsage') %></p>
72
+ </div>
73
+ <% end %>
74
+ </div>
75
+ </div>
@@ -0,0 +1,34 @@
1
+ <%= erb :_job_info, locals: { job: @dead, type: :dead } %>
2
+
3
+ <h3><%= t('Error') %></h3>
4
+ <div class="table_container">
5
+ <table class="error table table-bordered table-striped">
6
+ <tbody>
7
+ <tr>
8
+ <th><%= t('ErrorClass') %></th>
9
+ <td>
10
+ <code><%= @dead['error_class'] %></code>
11
+ </td>
12
+ </tr>
13
+ <tr>
14
+ <th><%= t('ErrorMessage') %></th>
15
+ <td><%= h(@dead['error_message']) %></td>
16
+ </tr>
17
+ <% if @dead.error_backtrace %>
18
+ <tr>
19
+ <th><%= t('ErrorBacktrace') %></th>
20
+ <td>
21
+ <code><%= @dead.error_backtrace.join("<br/>") %></code>
22
+ </td>
23
+ </tr>
24
+ <% end %>
25
+ </tbody>
26
+ </table>
27
+ </div>
28
+
29
+ <form class="form-horizontal" action="<%= root_path %>morgue/<%= job_params(@dead, @dead.score) %>" method="post">
30
+ <%= csrf_tag %>
31
+ <a class="btn btn-default" href="<%= root_path %>morgue"><%= t('GoBack') %></a>
32
+ <input class="btn btn-primary" type="submit" name="retry" value="<%= t('RetryNow') %>" />
33
+ <input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>" />
34
+ </form>
@@ -0,0 +1,41 @@
1
+ <!doctype html>
2
+ <html dir="<%= text_direction %>">
3
+ <head>
4
+ <title><%= environment_title_prefix %><%= Sidekiq::NAME %></title>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
+
8
+ <link href="<%= root_path %>stylesheets/bootstrap.css" media="screen" rel="stylesheet" type="text/css" />
9
+ <% if rtl? %>
10
+ <link href="<%= root_path %>stylesheets/bootstrap-rtl.min.css" media="screen" rel="stylesheet" type="text/css"/>
11
+ <% end %>
12
+
13
+ <link href="<%= root_path %>stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
14
+ <link href="<%= root_path %>stylesheets/application-dark.css" media="screen and (prefers-color-scheme: dark)" rel="stylesheet" type="text/css" />
15
+ <% if rtl? %>
16
+ <link href="<%= root_path %>stylesheets/application-rtl.css" media="screen" rel="stylesheet" type="text/css" />
17
+ <% end %>
18
+
19
+ <link rel="shortcut icon" type="image/ico" href="<%= root_path %>images/favicon.ico" />
20
+ <script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
21
+ <meta name="google" content="notranslate" />
22
+ <%= display_custom_head %>
23
+ </head>
24
+ <body class="admin" data-poll-path="<%= poll_path %>" data-locale="<%= locale %>">
25
+ <%= erb :_nav %>
26
+ <div id="page">
27
+ <div class="container">
28
+ <div class="row">
29
+ <div class="col-sm-12 summary_bar">
30
+ <%= erb :_summary %>
31
+ </div>
32
+
33
+ <div class="col-sm-12">
34
+ <%= yield %>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <%= erb :_footer %>
40
+ </body>
41
+ </html>
@@ -0,0 +1,78 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3><%= t('DeadJobs') %></h3>
4
+ </div>
5
+ <% if @dead.size > 0 && @total_size > @count %>
6
+ <div class="col-sm-4">
7
+ <%= erb :_paging, locals: { url: "#{root_path}morgue" } %>
8
+ </div>
9
+ <% end %>
10
+ <%= filtering('dead') %>
11
+ </header>
12
+
13
+ <% if @dead.size > 0 %>
14
+ <form action="<%= root_path %>morgue" method="post">
15
+ <%= csrf_tag %>
16
+ <div class="table_container">
17
+ <table class="table table-striped table-bordered table-white">
18
+ <thead>
19
+ <tr>
20
+ <th class="table-checkbox checkbox-column">
21
+ <label>
22
+ <input type="checkbox" class="check_all" />
23
+ </label>
24
+ </th>
25
+ <th><%= t('LastRetry') %></th>
26
+ <th><%= t('Queue') %></th>
27
+ <th><%= t('Job') %></th>
28
+ <th><%= t('Arguments') %></th>
29
+ <th><%= t('Error') %></th>
30
+ </tr>
31
+ </thead>
32
+ <% @dead.each do |entry| %>
33
+ <tr>
34
+ <td class="table-checkbox">
35
+ <label>
36
+ <input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
37
+ </label>
38
+ </td>
39
+ <td>
40
+ <a href="<%= root_path %>morgue/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
41
+ </td>
42
+ <td>
43
+ <a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
44
+ </td>
45
+ <td>
46
+ <%= entry.display_class %>
47
+ <%= display_tags(entry, "morgue") %>
48
+ </td>
49
+ <td>
50
+ <div class="args"><%= display_args(entry.display_args) %></div>
51
+ </td>
52
+ <td>
53
+ <% if entry.error? %>
54
+ <div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
55
+ <% end %>
56
+ </td>
57
+ </tr>
58
+ <% end %>
59
+ </table>
60
+ </div>
61
+ <input class="btn btn-primary btn-xs pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
+ <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
+ </form>
64
+
65
+ <% unfiltered? do %>
66
+ <form action="<%= root_path %>morgue/all/delete" method="post">
67
+ <%= csrf_tag %>
68
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
69
+ </form>
70
+ <form action="<%= root_path %>morgue/all/retry" method="post">
71
+ <%= csrf_tag %>
72
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
73
+ </form>
74
+ <% end %>
75
+
76
+ <% else %>
77
+ <div class="alert alert-success"><%= t('NoDeadJobsFound') %></div>
78
+ <% end %>
@@ -0,0 +1,55 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3>
4
+ <%= t('CurrentMessagesInQueue', :queue => h(@name)) %>
5
+ <% if @queue.paused? %>
6
+ <span class="label label-danger"><%= t('Paused') %></span>
7
+ <% end %>
8
+ <span class="badge badge-secondary"><%= number_with_delimiter(@total_size) %></span>
9
+ </h3>
10
+ </div>
11
+ <div class="col-sm-4 pull-right flip">
12
+ <%= erb :_paging, locals: { url: "#{root_path}queues/#{CGI.escape(@name)}" } %>
13
+ </div>
14
+ </header>
15
+ <div class="table_container">
16
+ <table class="queue table table-hover table-bordered table-striped">
17
+ <thead>
18
+ <th><a href="<%= url %>?direction=<%= params[:direction] == 'asc' ? 'desc' : 'asc' %>"># <%= sort_direction_label %></a></th>
19
+ <th><%= t('Job') %></th>
20
+ <th><%= t('Arguments') %></th>
21
+ <th></th>
22
+ </thead>
23
+ <% @messages.each_with_index do |msg, index| %>
24
+ <tr>
25
+ <% if params[:direction] == 'asc' %>
26
+ <td><%= @count * (@current_page - 1) + index + 1 %></td>
27
+ <% else %>
28
+ <td><%= @total_size - (@count * (@current_page - 1) + index) %></td>
29
+ <% end %>
30
+ <td>
31
+ <%= h(msg.display_class) %>
32
+ <%= display_tags(msg, nil) %>
33
+ </td>
34
+ <td>
35
+ <% a = msg.display_args %>
36
+ <% if a.inspect.size > 100 %>
37
+ <span class="worker_<%= index %>"><%= h(a.inspect[0..100]) + "... " %></span>
38
+ <button data-toggle="collapse" data-target=".worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
39
+ <div class="toggle worker_<%= index %>"><%= display_args(a) %></div>
40
+ <% else %>
41
+ <%= display_args(msg.display_args) %>
42
+ <% end %>
43
+ </td>
44
+ <td>
45
+ <form action="<%= root_path %>queues/<%= CGI.escape(@name) %>/delete" method="post">
46
+ <%= csrf_tag %>
47
+ <input name="key_val" value="<%= h msg.value %>" type="hidden" />
48
+ <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
49
+ </form>
50
+ </td>
51
+ </tr>
52
+ <% end %>
53
+ </table>
54
+ </div>
55
+ <%= erb :_paging, locals: { url: "#{root_path}queues/#{@name}" } %>
@@ -0,0 +1,38 @@
1
+ <h3><%= t('Queues') %></h3>
2
+
3
+ <div class="table_container">
4
+ <table class="queues table table-hover table-bordered table-striped table-white">
5
+ <thead>
6
+ <th><%= t('Queue') %></th>
7
+ <th><%= t('Size') %></th>
8
+ <th><%= t('Latency') %></th>
9
+ <th><%= t('Actions') %></th>
10
+ </thead>
11
+ <% @queues.each do |queue| %>
12
+ <tr>
13
+ <td>
14
+ <a href="<%= root_path %>queues/<%= CGI.escape(queue.name) %>"><%= h queue.name %></a>
15
+ <% if queue.paused? %>
16
+ <span class="label label-danger"><%= t('Paused') %></span>
17
+ <% end %>
18
+ </td>
19
+ <td><%= number_with_delimiter(queue.size) %> </td>
20
+ <td><% queue_latency = queue.latency %><%= number_with_delimiter(queue_latency.round(2)) %><%= (queue_latency < 60) ? '' : " (#{relative_time(Time.at(Time.now.to_f - queue_latency))})" %> </td>
21
+ <td class="delete-confirm">
22
+ <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
23
+ <%= csrf_tag %>
24
+ <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
25
+
26
+ <% if Sidekiq.pro? %>
27
+ <% if queue.paused? %>
28
+ <input class="btn btn-danger btn-xs" type="submit" name="unpause" value="<%= t('Unpause') %>" />
29
+ <% else %>
30
+ <input class="btn btn-danger btn-xs" type="submit" name="pause" value="<%= t('Pause') %>" />
31
+ <% end %>
32
+ <% end %>
33
+ </form>
34
+ </td>
35
+ </tr>
36
+ <% end %>
37
+ </table>
38
+ </div>
@@ -0,0 +1,83 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3><%= t('Retries') %></h3>
4
+ </div>
5
+ <% if @retries.size > 0 && @total_size > @count %>
6
+ <div class="col-sm-4">
7
+ <%= erb :_paging, locals: { url: "#{root_path}retries" } %>
8
+ </div>
9
+ <% end %>
10
+ <%= filtering('retries') %>
11
+ </header>
12
+
13
+ <% if @retries.size > 0 %>
14
+ <form action="<%= root_path %>retries" method="post">
15
+ <%= csrf_tag %>
16
+ <div class="table_container">
17
+ <table class="table table-striped table-bordered table-white">
18
+ <thead>
19
+ <tr>
20
+ <th class="table-checkbox checkbox-column">
21
+ <label>
22
+ <input type="checkbox" class="check_all" />
23
+ </label>
24
+ </th>
25
+ <th><%= t('NextRetry') %></th>
26
+ <th><%= t('RetryCount') %></th>
27
+ <th><%= t('Queue') %></th>
28
+ <th><%= t('Job') %></th>
29
+ <th><%= t('Arguments') %></th>
30
+ <th><%= t('Error') %></th>
31
+ </tr>
32
+ </thead>
33
+ <% @retries.each do |entry| %>
34
+ <tr>
35
+ <td class="table-checkbox">
36
+ <label>
37
+ <input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
38
+ </label>
39
+ </td>
40
+ <td>
41
+ <a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
42
+ </td>
43
+ <td><%= entry['retry_count'] %></td>
44
+ <td>
45
+ <a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
46
+ </td>
47
+ <td>
48
+ <%= entry.display_class %>
49
+ <%= display_tags(entry, "retries") %>
50
+ </td>
51
+ <td>
52
+ <div class="args"><%= display_args(entry.display_args) %></div>
53
+ </td>
54
+ <td>
55
+ <div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
56
+ </td>
57
+ </tr>
58
+ <% end %>
59
+ </table>
60
+ </div>
61
+ <input class="btn btn-primary btn-xs pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
62
+ <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
63
+ <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
64
+ </form>
65
+
66
+ <% unfiltered? do %>
67
+ <form action="<%= root_path %>retries/all/delete" method="post">
68
+ <%= csrf_tag %>
69
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
70
+ </form>
71
+ <form action="<%= root_path %>retries/all/retry" method="post">
72
+ <%= csrf_tag %>
73
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
74
+ </form>
75
+ <form action="<%= root_path %>retries/all/kill" method="post">
76
+ <%= csrf_tag %>
77
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
78
+ </form>
79
+ <% end %>
80
+
81
+ <% else %>
82
+ <div class="alert alert-success"><%= t('NoRetriesFound') %></div>
83
+ <% end %>