sidekiq 6.5.8 → 6.5.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fde4ce1db65a0c90d5fd32cff914e33fd238e52ce2f219d03bdc4d6accbdd645
4
- data.tar.gz: fd62df7cd374ea7bf2977b44da41c771da1deb8b84046e745fb042f66060eba0
3
+ metadata.gz: 21fe2977e3b230f1d63a6027ee9da7611fbd146e4b46e8f54ed917baa1040877
4
+ data.tar.gz: def0549c9e32ded7b4acd0014cd032a733ee31a37a39a30a55cfbb5029f3706a
5
5
  SHA512:
6
- metadata.gz: 1b6b3089616dbc25ce2e182ceca53c00b31b6a77adeda402b67436f1021dfc301e9f7ac2e1337e405ffdf0f6aab875fe6b228fdbceaa6e50685781cb5899e80e
7
- data.tar.gz: 37f2a103a2247c3541036044fd3ddb6e589eff483427b2f7c6ed02c6c349ec7a850c2adfdf868a22f018cf49bca3f94b65e3ecc8c46db9262c84b71c65593ddc
6
+ metadata.gz: 6b96a0340efeb1cda20fcb36e6191b67615551955e37bb3e4cfa0409becde7a22489dfd7225e9457f1de0d9c31bc2e458dbafe183e950f437b3d9d1bcb0e3cf5
7
+ data.tar.gz: cfb8a58210809775b8764766bfafeffd2a4dc9a725aeb7c39f18bfe5a4de20f9647577b274d1646ccc023050ab58d195975014d97f0d3b327239da165da0b870
data/Changes.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  [Sidekiq Changes](https://github.com/mperham/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/main/Ent-Changes.md)
4
4
 
5
+ 6.5.11
6
+ ----------
7
+
8
+ - Fix for Rails 7.1 [#6067]
9
+
10
+ 6.5.10
11
+ ----------
12
+
13
+ - Web UI DoS vector [#6045] CVE-2023-26141
14
+ - Fix broadcast logger with Rails 7.1 [#6054]
15
+
16
+ 6.5.9
17
+ ----------
18
+
19
+ - Ensure Sidekiq.options[:environment] == RAILS_ENV [#5932]
20
+
5
21
  6.5.8
6
22
  ----------
7
23
 
data/lib/sidekiq/cli.rb CHANGED
@@ -13,14 +13,14 @@ require "sidekiq/component"
13
13
  require "sidekiq/launcher"
14
14
 
15
15
  # module ScoutApm
16
- # VERSION = "5.3.1"
16
+ # VERSION = "5.3.1"
17
17
  # end
18
18
  fail <<~EOM if defined?(ScoutApm::VERSION) && ScoutApm::VERSION < "5.2.0"
19
-
20
-
21
- scout_apm v#{ScoutApm::VERSION} is unsafe with Sidekiq 6.5. Please run `bundle up scout_apm` to upgrade to 5.2.0 or greater.
22
-
23
-
19
+
20
+
21
+ scout_apm v#{ScoutApm::VERSION} is unsafe with Sidekiq 6.5. Please run `bundle up scout_apm` to upgrade to 5.2.0 or greater.
22
+
23
+
24
24
  EOM
25
25
 
26
26
  module Sidekiq # :nodoc:
@@ -225,6 +225,7 @@ module Sidekiq # :nodoc:
225
225
  # Both Sinatra 2.0+ and Sidekiq support this term.
226
226
  # RAILS_ENV and RACK_ENV are there for legacy support.
227
227
  @environment = cli_env || ENV["APP_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
228
+ config[:environment] = @environment
228
229
  end
229
230
 
230
231
  def symbolize_keys_deep!(hash)
@@ -176,7 +176,7 @@ module Sidekiq
176
176
  def enqueue_to_in(queue, interval, klass, *args)
177
177
  int = interval.to_f
178
178
  now = Time.now.to_f
179
- ts = (int < 1_000_000_000 ? now + int : int)
179
+ ts = ((int < 1_000_000_000) ? now + int : int)
180
180
 
181
181
  item = {"class" => klass, "args" => args, "at" => ts, "queue" => queue}
182
182
  item.delete("at") if ts <= now
@@ -123,7 +123,7 @@ module Sidekiq
123
123
  def series_avg(metric = "ms")
124
124
  series[metric].each_with_object(Hash.new(0)) do |(bucket, value), result|
125
125
  completed = series.dig("p", bucket) - series.dig("f", bucket)
126
- result[bucket] = completed == 0 ? 0 : value.to_f / completed
126
+ result[bucket] = (completed == 0) ? 0 : value.to_f / completed
127
127
  end
128
128
  end
129
129
  end
@@ -101,7 +101,7 @@ class Sidekiq::Monitor
101
101
  tags = [
102
102
  process["tag"],
103
103
  process["labels"],
104
- (process["quiet"] == "true" ? "quiet" : nil)
104
+ ((process["quiet"] == "true") ? "quiet" : nil)
105
105
  ].flatten.compact
106
106
  tags.any? ? "[#{tags.join("] [")}]" : nil
107
107
  end
@@ -3,7 +3,7 @@
3
3
  module Sidekiq
4
4
  module Paginator
5
5
  def page(key, pageidx = 1, page_size = 25, opts = nil)
6
- current_page = pageidx.to_i < 1 ? 1 : pageidx.to_i
6
+ current_page = (pageidx.to_i < 1) ? 1 : pageidx.to_i
7
7
  pageidx = current_page - 1
8
8
  total_size = 0
9
9
  items = []
@@ -45,7 +45,7 @@ module Sidekiq
45
45
  end
46
46
 
47
47
  def page_items(items, pageidx = 1, page_size = 25)
48
- current_page = pageidx.to_i < 1 ? 1 : pageidx.to_i
48
+ current_page = (pageidx.to_i < 1) ? 1 : pageidx.to_i
49
49
  pageidx = current_page - 1
50
50
  starting = pageidx * page_size
51
51
  items = items.to_a
data/lib/sidekiq/rails.rb CHANGED
@@ -37,17 +37,6 @@ module Sidekiq
37
37
  end
38
38
  end
39
39
 
40
- initializer "sidekiq.rails_logger" do
41
- Sidekiq.configure_server do |config|
42
- # This is the integration code necessary so that if a job uses `Rails.logger.info "Hello"`,
43
- # it will appear in the Sidekiq console with all of the job context. See #5021 and
44
- # https://github.com/rails/rails/blob/b5f2b550f69a99336482739000c58e4e04e033aa/railties/lib/rails/commands/server/server_command.rb#L82-L84
45
- unless ::Rails.logger == config.logger || ::ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, $stdout)
46
- ::Rails.logger.extend(::ActiveSupport::Logger.broadcast(config.logger))
47
- end
48
- end
49
- end
50
-
51
40
  config.before_configuration do
52
41
  dep = ActiveSupport::Deprecation.new("7.0", "Sidekiq")
53
42
  dep.deprecate_methods(Sidekiq.singleton_class,
@@ -62,6 +51,16 @@ module Sidekiq
62
51
  config.after_initialize do
63
52
  Sidekiq.configure_server do |config|
64
53
  config[:reloader] = Sidekiq::Rails::Reloader.new
54
+
55
+ # This is the integration code necessary so that if a job uses `Rails.logger.info "Hello"`,
56
+ # it will appear in the Sidekiq console with all of the job context.
57
+ unless ::Rails.logger == config.logger || ::ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, $stdout)
58
+ if ::Rails::VERSION::STRING < "7.1"
59
+ ::Rails.logger.extend(::ActiveSupport::Logger.broadcast(config.logger))
60
+ else
61
+ ::Rails.logger = ::ActiveSupport::BroadcastLogger.new(::Rails.logger, config.logger)
62
+ end
63
+ end
65
64
  end
66
65
  end
67
66
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "6.5.8"
4
+ VERSION = "6.5.11"
5
5
  end
@@ -137,7 +137,7 @@ module Sidekiq
137
137
  end
138
138
 
139
139
  def sort_direction_label
140
- params[:direction] == "asc" ? "&uarr;" : "&darr;"
140
+ (params[:direction] == "asc") ? "&uarr;" : "&darr;"
141
141
  end
142
142
 
143
143
  def workset
@@ -188,7 +188,7 @@ module Sidekiq
188
188
  end
189
189
 
190
190
  def current_status
191
- workset.size == 0 ? "idle" : "active"
191
+ (workset.size == 0) ? "idle" : "active"
192
192
  end
193
193
 
194
194
  def relative_time(time)
@@ -221,7 +221,7 @@ module Sidekiq
221
221
  end
222
222
 
223
223
  def truncate(text, truncate_after_chars = 2000)
224
- truncate_after_chars && text.size > truncate_after_chars ? "#{text[0..truncate_after_chars]}..." : text
224
+ (truncate_after_chars && text.size > truncate_after_chars) ? "#{text[0..truncate_after_chars]}..." : text
225
225
  end
226
226
 
227
227
  def display_args(args, truncate_after_chars = 2000)
@@ -257,7 +257,7 @@ module Sidekiq
257
257
  def at(interval)
258
258
  int = interval.to_f
259
259
  now = Time.now.to_f
260
- ts = (int < 1_000_000_000 ? now + int : int)
260
+ ts = ((int < 1_000_000_000) ? now + int : int)
261
261
  # Optimization to enqueue something now that is scheduled to go out now or in the past
262
262
  @opts["at"] = ts if ts > now
263
263
  self
@@ -324,7 +324,7 @@ module Sidekiq
324
324
  def perform_in(interval, *args)
325
325
  int = interval.to_f
326
326
  now = Time.now.to_f
327
- ts = (int < 1_000_000_000 ? now + int : int)
327
+ ts = ((int < 1_000_000_000) ? now + int : int)
328
328
 
329
329
  item = {"class" => self, "args" => args}
330
330
 
@@ -122,6 +122,7 @@ function checkResponse(resp) {
122
122
 
123
123
  function scheduleLivePoll() {
124
124
  let ti = parseInt(localStorage.sidekiqTimeInterval) || 5000;
125
+ if (ti < 2000) { ti = 2000 }
125
126
  livePollTimer = setTimeout(livePollCallback, ti);
126
127
  }
127
128
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.5.8
4
+ version: 6.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-04 00:00:00.000000000 Z
11
+ date: 2023-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.2.32
221
+ rubygems_version: 3.4.20
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Simple, efficient background processing for Ruby