sidekiq 6.5.8 → 6.5.10

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: b12bc33857058ca07b776ff3f9e39eb98a84533c8f1c78367626a6a514d53607
4
+ data.tar.gz: d783f3060fc348786c7128ffc3b14703d9ee676a1a4972d88bc2e995fbabfd16
5
5
  SHA512:
6
- metadata.gz: 1b6b3089616dbc25ce2e182ceca53c00b31b6a77adeda402b67436f1021dfc301e9f7ac2e1337e405ffdf0f6aab875fe6b228fdbceaa6e50685781cb5899e80e
7
- data.tar.gz: 37f2a103a2247c3541036044fd3ddb6e589eff483427b2f7c6ed02c6c349ec7a850c2adfdf868a22f018cf49bca3f94b65e3ecc8c46db9262c84b71c65593ddc
6
+ metadata.gz: 0471f10240cbf2a1e2337e50111690a32153da3fa23f3e8462ff545dcc9cde06d67574cc26ed1c2be3fed88d31a34002ec30641a6c40a4f668a44005e9d5d297
7
+ data.tar.gz: 88f36a02144dbdf6fa58eb5d58f9615d99321049a76717dd2a4bd03a0bc7ebfe69e4709b860afd22782c80e5a868d8c85026d15ce42824675e3f6f09534c6335
data/Changes.md CHANGED
@@ -2,6 +2,17 @@
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.10
6
+ ----------
7
+
8
+ - Web UI DoS vector [#6045] CVE-2023-26141
9
+ - Fix broadcast logger with Rails 7.1 [#6054]
10
+
11
+ 6.5.9
12
+ ----------
13
+
14
+ - Ensure Sidekiq.options[:environment] == RAILS_ENV [#5932]
15
+
5
16
  6.5.8
6
17
  ----------
7
18
 
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
@@ -62,6 +62,16 @@ module Sidekiq
62
62
  config.after_initialize do
63
63
  Sidekiq.configure_server do |config|
64
64
  config[:reloader] = Sidekiq::Rails::Reloader.new
65
+
66
+ # This is the integration code necessary so that if a job uses `Rails.logger.info "Hello"`,
67
+ # it will appear in the Sidekiq console with all of the job context.
68
+ unless ::Rails.logger == config.logger || ::ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, $stdout)
69
+ if ::Rails::VERSION::STRING < "7.1"
70
+ ::Rails.logger.extend(::ActiveSupport::Logger.broadcast(config.logger))
71
+ else
72
+ ::Rails.logger = ::ActiveSupport::BroadcastLogger.new(::Rails.logger, config.logger)
73
+ end
74
+ end
65
75
  end
66
76
  end
67
77
  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.10"
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.10
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-02 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.7
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Simple, efficient background processing for Ruby