sidekiq 7.3.6 → 7.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c9bd0a03b27535a34a0525397e84c429a9332e6754dba43c088558ab8f362e9
4
- data.tar.gz: '08fee2db2d83996d1df6f78e7eb9a226cb98d951cba336dd422771f9127cf95a'
3
+ metadata.gz: dccc402e8f4e309a47a2adb62418fa29989012e8c94f34aa11200b098dc375f2
4
+ data.tar.gz: 71b64a582d5971b045d60bae38dc26da265b60ff9a099ca3b2f9c7df9035e805
5
5
  SHA512:
6
- metadata.gz: f4876eb7594d0c87e4dba08a752dbcb65bbf45ae8213fb9b9ee6a1e12d7a48750c161ffe632f3b13eacfed73de3c3c73a9dc06a2548ddf7e5f6dde0f7de161bd
7
- data.tar.gz: a0f485adef4ba6751114daf0d2c1d509966d530bc620e00ebf17a9c244f1eb0821ae5e8214d88d3652106d932cae7acfd2b66874647acc8c33fe6ec2e3b9d691
6
+ metadata.gz: d9148b613a222ca9617ceebe25bb04a5d086edacdafad4a426b6232662d3b583db462dc5e0491297f7859037c5166bcb541bddcd3949f6d3b5a1c2e3fc572b65
7
+ data.tar.gz: 93a797cefd1a68adb236c7538c28571467c328d6965af0bc5ce505a1391d6f5b6e2ae2c87b42110e837dcfa8d788aff55309806bbb1bcd181e205c3bc66adc29
data/Changes.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  [Sidekiq Changes](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/sidekiq/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/sidekiq/sidekiq/blob/main/Ent-Changes.md)
4
4
 
5
+ 7.3.9
6
+ ----------
7
+
8
+ - Only require activejob if necessary [#6584]
9
+ - Fix iterable job cancellation [#6589]
10
+ - Web UI accessibility improvements [#6604]
11
+
12
+ 7.3.8
13
+ ----------
14
+
15
+ - Fix dead tag links [#6554]
16
+ - Massive Web UI performance improvement, some pages up to 15x faster [#6555]
17
+
18
+ 7.3.7
19
+ ----------
20
+
21
+ - Backport `Sidekiq::Web.configure` for compatibility with 8.0 [#6532]
22
+ - Backport `url_params(key)` and `route_params(key)` for compatibility with 8.0 [#6532]
23
+ - Various fixes for UI filtering [#6508]
24
+ - Tune `inspect` for internal S::Components to keep size managable [#6553]
25
+
5
26
  7.3.6
6
27
  ----------
7
28
 
@@ -1,18 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Sidekiq
4
- module ActiveJob
5
- # @api private
6
- class Wrapper
7
- include Sidekiq::Job
8
-
9
- def perform(job_data)
10
- ::ActiveJob::Base.execute(job_data.merge("provider_job_id" => jid))
11
- end
12
- end
13
- end
14
- end
15
-
16
3
  module ActiveJob
17
4
  module QueueAdapters
18
5
  # Explicitly remove the implementation existing in older rails'.
@@ -64,5 +64,27 @@ module Sidekiq
64
64
  end
65
65
  arr.clear if oneshot # once we've fired an event, we never fire it again
66
66
  end
67
+
68
+ # When you have a large tree of components, the `inspect` output
69
+ # can get out of hand, especially with lots of Sidekiq::Config
70
+ # references everywhere. We avoid calling `inspect` on more complex
71
+ # state and use `to_s` instead to keep output manageable, #6553
72
+ def inspect
73
+ "#<#{self.class.name} #{
74
+ instance_variables.map do |name|
75
+ value = instance_variable_get(name)
76
+ case value
77
+ when Proc
78
+ "#{name}=#{value}"
79
+ when Sidekiq::Config
80
+ "#{name}=#{value}"
81
+ when Sidekiq::Component
82
+ "#{name}=#{value}"
83
+ else
84
+ "#{name}=#{value.inspect}"
85
+ end
86
+ end.join(", ")
87
+ }>"
88
+ end
67
89
  end
68
90
  end
@@ -61,6 +61,12 @@ module Sidekiq
61
61
  def_delegators :@options, :[], :[]=, :fetch, :key?, :has_key?, :merge!, :dig
62
62
  attr_reader :capsules
63
63
 
64
+ def inspect
65
+ "#<#{self.class.name} @options=#{
66
+ @options.except(:lifecycle_events, :reloader, :death_handlers, :error_handlers).inspect
67
+ }>"
68
+ end
69
+
64
70
  def to_json(*)
65
71
  Sidekiq.dump_json(@options)
66
72
  end
@@ -200,7 +200,7 @@ module Sidekiq
200
200
  if ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - state_flushed_at >= STATE_FLUSH_INTERVAL || is_interrupted
201
201
  _, _, cancelled = flush_state
202
202
  state_flushed_at = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
203
- if cancelled == 1
203
+ if cancelled
204
204
  @_cancelled = true
205
205
  logger.info { "Job cancelled" }
206
206
  return true
@@ -2,6 +2,12 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Paginator
5
+ TYPE_CACHE = {
6
+ "dead" => "zset",
7
+ "retry" => "zset",
8
+ "schedule" => "zset"
9
+ }
10
+
5
11
  def page(key, pageidx = 1, page_size = 25, opts = nil)
6
12
  current_page = (pageidx.to_i < 1) ? 1 : pageidx.to_i
7
13
  pageidx = current_page - 1
data/lib/sidekiq/rails.rb CHANGED
@@ -4,6 +4,17 @@ require "sidekiq/job"
4
4
  require "rails"
5
5
 
6
6
  module Sidekiq
7
+ module ActiveJob
8
+ # @api private
9
+ class Wrapper
10
+ include Sidekiq::Job
11
+
12
+ def perform(job_data)
13
+ ::ActiveJob::Base.execute(job_data.merge("provider_job_id" => jid))
14
+ end
15
+ end
16
+ end
17
+
7
18
  class Rails < ::Rails::Engine
8
19
  class Reloader
9
20
  def initialize(app = ::Rails.application)
@@ -39,8 +50,7 @@ module Sidekiq
39
50
  # end
40
51
  initializer "sidekiq.active_job_integration" do
41
52
  ActiveSupport.on_load(:active_job) do
42
- require "active_job/queue_adapters/sidekiq_adapter"
43
-
53
+ require_relative "../active_job/queue_adapters/sidekiq_adapter"
44
54
  include ::Sidekiq::Job::Options unless respond_to?(:sidekiq_options)
45
55
  end
46
56
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "7.3.6"
4
+ VERSION = "7.3.9"
5
5
  MAJOR = 7
6
6
 
7
7
  def self.gem_version
@@ -27,6 +27,7 @@ module Sidekiq
27
27
  redirect current_location
28
28
  end
29
29
 
30
+ # deprecated, will warn in 8.0
30
31
  def params
31
32
  indifferent_hash = Hash.new { |hash, key| hash[key.to_s] if Symbol === key }
32
33
 
@@ -36,8 +37,19 @@ module Sidekiq
36
37
  indifferent_hash
37
38
  end
38
39
 
39
- def route_params
40
- env[WebRouter::ROUTE_PARAMS]
40
+ # Use like `url_params("page")` within your action blocks
41
+ def url_params(key)
42
+ request.params[key]
43
+ end
44
+
45
+ # Use like `route_params(:name)` within your action blocks
46
+ # key is required in 8.0, nil is only used for backwards compatibility
47
+ def route_params(key = nil)
48
+ if key
49
+ env[WebRouter::ROUTE_PARAMS][key]
50
+ else
51
+ env[WebRouter::ROUTE_PARAMS]
52
+ end
41
53
  end
42
54
 
43
55
  def session
@@ -184,7 +184,7 @@ module Sidekiq
184
184
  end
185
185
 
186
186
  post "/morgue" do
187
- redirect(request.path) unless params["key"]
187
+ redirect(request.path) unless url_params("key")
188
188
 
189
189
  params["key"].each do |key|
190
190
  job = Sidekiq::DeadSet.new.fetch(*parse_params(key)).first
@@ -207,7 +207,7 @@ module Sidekiq
207
207
  end
208
208
 
209
209
  post "/morgue/:key" do
210
- key = route_params[:key]
210
+ key = route_params(:key)
211
211
  halt(404) unless key
212
212
 
213
213
  job = Sidekiq::DeadSet.new.fetch(*parse_params(key)).first
@@ -217,7 +217,7 @@ module Sidekiq
217
217
  end
218
218
 
219
219
  get "/retries" do
220
- x = params[:substr]
220
+ x = url_params("substr")
221
221
 
222
222
  if x && x != ""
223
223
  @retries = search(Sidekiq::RetrySet.new, x)
@@ -52,11 +52,11 @@ module Sidekiq
52
52
  end
53
53
 
54
54
  def strings(lang)
55
- @strings ||= {}
55
+ @@strings ||= {}
56
56
 
57
57
  # Allow sidekiq-web extensions to add locale paths
58
58
  # so extensions can be localized
59
- @strings[lang] ||= settings.locales.each_with_object({}) do |path, global|
59
+ @@strings[lang] ||= settings.locales.each_with_object({}) do |path, global|
60
60
  find_locale_files(lang).each do |file|
61
61
  strs = YAML.safe_load(File.read(file))
62
62
  global.merge!(strs[lang])
@@ -77,19 +77,19 @@ module Sidekiq
77
77
  end
78
78
 
79
79
  def clear_caches
80
- @strings = nil
81
- @locale_files = nil
82
- @available_locales = nil
80
+ @@strings = nil
81
+ @@locale_files = nil
82
+ @@available_locales = nil
83
83
  end
84
84
 
85
85
  def locale_files
86
- @locale_files ||= settings.locales.flat_map { |path|
86
+ @@locale_files ||= settings.locales.flat_map { |path|
87
87
  Dir["#{path}/*.yml"]
88
88
  }
89
89
  end
90
90
 
91
91
  def available_locales
92
- @available_locales ||= Set.new(locale_files.map { |path| File.basename(path, ".yml") })
92
+ @@available_locales ||= Set.new(locale_files.map { |path| File.basename(path, ".yml") })
93
93
  end
94
94
 
95
95
  def find_locale_files(lang)
@@ -111,7 +111,7 @@ module Sidekiq
111
111
  if within.nil?
112
112
  ::Rack::Utils.escape_html(jid)
113
113
  else
114
- "<a href='#{root_path}filter/#{within}?substr=#{jid}'>#{::Rack::Utils.escape_html(jid)}</a>"
114
+ "<a href='#{root_path}#{within}?substr=#{jid}'>#{::Rack::Utils.escape_html(jid)}</a>"
115
115
  end
116
116
  end
117
117
 
@@ -184,7 +184,8 @@ module Sidekiq
184
184
 
185
185
  # sidekiq/sidekiq#3243
186
186
  def unfiltered?
187
- yield unless env["PATH_INFO"].start_with?("/filter/")
187
+ s = url_params("substr")
188
+ yield unless s && s.size > 0
188
189
  end
189
190
 
190
191
  def get_locale
data/lib/sidekiq/web.rb CHANGED
@@ -50,6 +50,11 @@ module Sidekiq
50
50
  end
51
51
 
52
52
  class << self
53
+ # Forward compatibility with 8.0
54
+ def configure
55
+ yield self
56
+ end
57
+
53
58
  def settings
54
59
  self
55
60
  end
data/sidekiq.gemspec CHANGED
@@ -27,4 +27,5 @@ Gem::Specification.new do |gem|
27
27
  gem.add_dependency "connection_pool", ">= 2.3.0"
28
28
  gem.add_dependency "rack", ">= 2.2.4"
29
29
  gem.add_dependency "logger"
30
+ gem.add_dependency "base64"
30
31
  end
@@ -83,6 +83,8 @@ class RealtimeChart extends DashboardChart {
83
83
  this.chart.data.datasets[1].data.push(failed);
84
84
  this.chart.update();
85
85
 
86
+ updateScreenReaderDashboardValues(processed, failed);
87
+
86
88
  updateStatsSummary(this.stats.sidekiq);
87
89
  updateRedisStats(this.stats.redis);
88
90
  updateFooterUTCTime(this.stats.server_utc_time);
@@ -36,6 +36,12 @@ var ready = (callback) => {
36
36
  else document.addEventListener("DOMContentLoaded", callback);
37
37
  }
38
38
 
39
+ var updateScreenReaderDashboardValues = function(processed, failed) {
40
+ let lastDashboardUpdateSpan = document.getElementById("sr-last-dashboard-update");
41
+ var updateText = document.getElementById("sr-last-dashboard-update-template").innerText;
42
+ lastDashboardUpdateSpan.innerText = updateText.replace("PROCESSED_COUNT", processed).replace("FAILED_COUNT", failed);
43
+ }
44
+
39
45
  ready(() => {
40
46
  var sldr = document.getElementById('sldr');
41
47
  if (typeof localStorage.sidekiqTimeInterval !== 'undefined') {
data/web/locales/en.yml CHANGED
@@ -34,6 +34,8 @@ en:
34
34
  Jobs: Jobs
35
35
  Kill: Kill
36
36
  KillAll: Kill All
37
+ Language: Language
38
+ LastDashboardUpdateTemplateLiteral: "Latest poll: Processed: PROCESSED_COUNT. Failed: FAILED_COUNT."
37
39
  LastRetry: Last Retry
38
40
  Latency: Latency
39
41
  LivePoll: Live Poll
@@ -53,6 +55,7 @@ en:
53
55
  PeakMemoryUsage: Peak Memory Usage
54
56
  Plugins: Plugins
55
57
  PollingInterval: Polling interval
58
+ PollingIntervalMilliseconds: Polling interval milliseconds
56
59
  Process: Process
57
60
  Processed: Processed
58
61
  Processes: Processes
@@ -17,8 +17,7 @@
17
17
  <li>
18
18
  <form id="locale-form" class="form-inline" action="<%= root_path %>change_locale" method="post">
19
19
  <%= csrf_tag %>
20
- <label class="sr-only" for="locale">Language</label>
21
- <select id="locale-select" class="form-control" name="locale">
20
+ <select id="locale-select" class="form-control" aria-label="<%= t("Language") %>" name="locale">
22
21
  <% available_locales.each do |locale_option| %>
23
22
  <% if locale_option == locale %>
24
23
  <option selected value="<%= locale_option %>"><%= locale_option %></option>
@@ -11,11 +11,14 @@
11
11
  <span class="interval-slider-label"><%= t('PollingInterval') %>:</span>
12
12
  <span id="sldr-text" class="current-interval">5 s</span>
13
13
  <br/>
14
- <input id="sldr" type="range" min="2000" max="20000" step="1000" value="5000"/>
14
+ <input id="sldr" aria-label="<%= t("PollingIntervalMilliseconds") %>" type="range" min="2000" max="20000" step="1000" value="5000"/>
15
15
  </div>
16
16
  </div>
17
17
 
18
18
  <div class="row chart">
19
+ <span id="sr-last-dashboard-update-template" hidden="hidden"><%= t("LastDashboardUpdateTemplateLiteral") %></span>
20
+ <span id="sr-last-dashboard-update" class="sr-only" role="status"></span>
21
+
19
22
  <canvas id="realtime-chart">
20
23
  <%= to_json({
21
24
  processedLabel: t('Processed'),
data/web/views/morgue.erb CHANGED
@@ -3,7 +3,7 @@
3
3
  <% if @dead.size > 0 && @total_size > @count %>
4
4
  <%= erb :_paging, locals: { url: "#{root_path}morgue" } %>
5
5
  <% end %>
6
- <%= filtering('dead') %>
6
+ <%= filtering('morgue') %>
7
7
  </div>
8
8
 
9
9
  <% if @dead.size > 0 %>
@@ -40,7 +40,7 @@
40
40
  </td>
41
41
  <td>
42
42
  <%= entry.display_class %>
43
- <%= display_tags(entry, "dead") %>
43
+ <%= display_tags(entry, "morgue") %>
44
44
  </td>
45
45
  <td>
46
46
  <div class="args"><%= display_args(entry.display_args) %></div>
data/web/views/queue.erb CHANGED
@@ -15,7 +15,7 @@
15
15
  <th><%= t('Job') %></th>
16
16
  <th><%= t('Arguments') %></th>
17
17
  <th><%= t('Context') %></th>
18
- <th></th>
18
+ <th><%= t('Actions') %></th>
19
19
  </thead>
20
20
  <% @jobs.each_with_index do |job, index| %>
21
21
  <tr title="<%= job.jid %>">
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.6
4
+ version: 7.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-20 00:00:00.000000000 Z
10
+ date: 2025-02-14 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: redis-client
@@ -66,6 +65,20 @@ dependencies:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: base64
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
69
82
  description: Simple, efficient background processing for Ruby.
70
83
  email:
71
84
  - info@contribsys.com
@@ -217,7 +230,6 @@ metadata:
217
230
  changelog_uri: https://github.com/sidekiq/sidekiq/blob/main/Changes.md
218
231
  source_code_uri: https://github.com/sidekiq/sidekiq
219
232
  rubygems_mfa_required: 'true'
220
- post_install_message:
221
233
  rdoc_options: []
222
234
  require_paths:
223
235
  - lib
@@ -232,8 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
244
  - !ruby/object:Gem::Version
233
245
  version: '0'
234
246
  requirements: []
235
- rubygems_version: 3.5.16
236
- signing_key:
247
+ rubygems_version: 3.6.2
237
248
  specification_version: 4
238
249
  summary: Simple, efficient background processing for Ruby
239
250
  test_files: []