sidekiq 6.4.2 → 6.5.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.

@@ -5,8 +5,81 @@ require "redis"
5
5
  require "uri"
6
6
 
7
7
  module Sidekiq
8
- class RedisConnection
8
+ module RedisConnection
9
+ class RedisAdapter
10
+ BaseError = Redis::BaseError
11
+ CommandError = Redis::CommandError
12
+
13
+ def initialize(options)
14
+ warn("Usage of the 'redis' gem within Sidekiq itself is deprecated, Sidekiq 7.0 will only use the new, simpler 'redis-client' gem", caller) if ENV["SIDEKIQ_REDIS_CLIENT"] == "1"
15
+ @options = options
16
+ end
17
+
18
+ def new_client
19
+ namespace = @options[:namespace]
20
+
21
+ client = Redis.new client_opts(@options)
22
+ if namespace
23
+ begin
24
+ require "redis/namespace"
25
+ Redis::Namespace.new(namespace, redis: client)
26
+ rescue LoadError
27
+ Sidekiq.logger.error("Your Redis configuration uses the namespace '#{namespace}' but the redis-namespace gem is not included in the Gemfile." \
28
+ "Add the gem to your Gemfile to continue using a namespace. Otherwise, remove the namespace parameter.")
29
+ exit(-127)
30
+ end
31
+ else
32
+ client
33
+ end
34
+ end
35
+
36
+ private
37
+
38
+ def client_opts(options)
39
+ opts = options.dup
40
+ if opts[:namespace]
41
+ opts.delete(:namespace)
42
+ end
43
+
44
+ if opts[:network_timeout]
45
+ opts[:timeout] = opts[:network_timeout]
46
+ opts.delete(:network_timeout)
47
+ end
48
+
49
+ opts[:driver] ||= Redis::Connection.drivers.last || "ruby"
50
+
51
+ # Issue #3303, redis-rb will silently retry an operation.
52
+ # This can lead to duplicate jobs if Sidekiq::Client's LPUSH
53
+ # is performed twice but I believe this is much, much rarer
54
+ # than the reconnect silently fixing a problem; we keep it
55
+ # on by default.
56
+ opts[:reconnect_attempts] ||= 1
57
+
58
+ opts
59
+ end
60
+ end
61
+
62
+ @adapter = RedisAdapter
63
+
9
64
  class << self
65
+ attr_reader :adapter
66
+
67
+ # RedisConnection.adapter = :redis
68
+ # RedisConnection.adapter = :redis_client
69
+ def adapter=(adapter)
70
+ raise "no" if adapter == self
71
+ result = case adapter
72
+ when :redis
73
+ RedisAdapter
74
+ when Class
75
+ adapter
76
+ else
77
+ require "sidekiq/#{adapter}_adapter"
78
+ nil
79
+ end
80
+ @adapter = result if result
81
+ end
82
+
10
83
  def create(options = {})
11
84
  symbolized_options = options.transform_keys(&:to_sym)
12
85
 
@@ -19,20 +92,21 @@ module Sidekiq
19
92
  elsif Sidekiq.server?
20
93
  # Give ourselves plenty of connections. pool is lazy
21
94
  # so we won't create them until we need them.
22
- Sidekiq.options[:concurrency] + 5
95
+ Sidekiq[:concurrency] + 5
23
96
  elsif ENV["RAILS_MAX_THREADS"]
24
97
  Integer(ENV["RAILS_MAX_THREADS"])
25
98
  else
26
99
  5
27
100
  end
28
101
 
29
- verify_sizing(size, Sidekiq.options[:concurrency]) if Sidekiq.server?
102
+ verify_sizing(size, Sidekiq[:concurrency]) if Sidekiq.server?
30
103
 
31
104
  pool_timeout = symbolized_options[:pool_timeout] || 1
32
105
  log_info(symbolized_options)
33
106
 
107
+ redis_config = adapter.new(symbolized_options)
34
108
  ConnectionPool.new(timeout: pool_timeout, size: size) do
35
- build_client(symbolized_options)
109
+ redis_config.new_client
36
110
  end
37
111
  end
38
112
 
@@ -50,47 +124,6 @@ module Sidekiq
50
124
  raise ArgumentError, "Your Redis connection pool is too small for Sidekiq. Your pool has #{size} connections but must have at least #{concurrency + 2}" if size < (concurrency + 2)
51
125
  end
52
126
 
53
- def build_client(options)
54
- namespace = options[:namespace]
55
-
56
- client = Redis.new client_opts(options)
57
- if namespace
58
- begin
59
- require "redis/namespace"
60
- Redis::Namespace.new(namespace, redis: client)
61
- rescue LoadError
62
- Sidekiq.logger.error("Your Redis configuration uses the namespace '#{namespace}' but the redis-namespace gem is not included in the Gemfile." \
63
- "Add the gem to your Gemfile to continue using a namespace. Otherwise, remove the namespace parameter.")
64
- exit(-127)
65
- end
66
- else
67
- client
68
- end
69
- end
70
-
71
- def client_opts(options)
72
- opts = options.dup
73
- if opts[:namespace]
74
- opts.delete(:namespace)
75
- end
76
-
77
- if opts[:network_timeout]
78
- opts[:timeout] = opts[:network_timeout]
79
- opts.delete(:network_timeout)
80
- end
81
-
82
- opts[:driver] ||= Redis::Connection.drivers.last || "ruby"
83
-
84
- # Issue #3303, redis-rb will silently retry an operation.
85
- # This can lead to duplicate jobs if Sidekiq::Client's LPUSH
86
- # is performed twice but I believe this is much, much rarer
87
- # than the reconnect silently fixing a problem; we keep it
88
- # on by default.
89
- opts[:reconnect_attempts] ||= 1
90
-
91
- opts
92
- end
93
-
94
127
  def log_info(options)
95
128
  redacted = "REDACTED"
96
129
 
@@ -110,9 +143,9 @@ module Sidekiq
110
143
  sentinel[:password] = redacted if sentinel[:password]
111
144
  end
112
145
  if Sidekiq.server?
113
- Sidekiq.logger.info("Booting Sidekiq #{Sidekiq::VERSION} with redis options #{scrubbed_options}")
146
+ Sidekiq.logger.info("Booting Sidekiq #{Sidekiq::VERSION} with #{adapter.name} options #{scrubbed_options}")
114
147
  else
115
- Sidekiq.logger.debug("#{Sidekiq::NAME} client with redis options #{scrubbed_options}")
148
+ Sidekiq.logger.debug("#{Sidekiq::NAME} client with #{adapter.name} options #{scrubbed_options}")
116
149
  end
117
150
  end
118
151
 
@@ -0,0 +1,29 @@
1
+ require "forwardable"
2
+
3
+ module Sidekiq
4
+ class RingBuffer
5
+ include Enumerable
6
+ extend Forwardable
7
+ def_delegators :@buf, :[], :each, :size
8
+
9
+ def initialize(size, default = 0)
10
+ @size = size
11
+ @buf = Array.new(size, default)
12
+ @index = 0
13
+ end
14
+
15
+ def <<(element)
16
+ @buf[@index % @size] = element
17
+ @index += 1
18
+ element
19
+ end
20
+
21
+ def buffer
22
+ @buf
23
+ end
24
+
25
+ def reset(default = 0)
26
+ @buf.fill(default)
27
+ end
28
+ end
29
+ end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "sidekiq"
4
- require "sidekiq/util"
5
4
  require "sidekiq/api"
5
+ require "sidekiq/component"
6
6
 
7
7
  module Sidekiq
8
8
  module Scheduled
@@ -52,8 +52,8 @@ module Sidekiq
52
52
  @lua_zpopbyscore_sha = raw_conn.script(:load, LUA_ZPOPBYSCORE)
53
53
  end
54
54
 
55
- conn.evalsha(@lua_zpopbyscore_sha, keys: keys, argv: argv)
56
- rescue Redis::CommandError => e
55
+ conn.evalsha(@lua_zpopbyscore_sha, keys, argv)
56
+ rescue RedisConnection.adapter::CommandError => e
57
57
  raise unless e.message.start_with?("NOSCRIPT")
58
58
 
59
59
  @lua_zpopbyscore_sha = nil
@@ -67,12 +67,13 @@ module Sidekiq
67
67
  # just pops the job back onto its original queue so the
68
68
  # workers can pick it up like any other job.
69
69
  class Poller
70
- include Util
70
+ include Sidekiq::Component
71
71
 
72
72
  INITIAL_WAIT = 10
73
73
 
74
- def initialize
75
- @enq = (Sidekiq.options[:scheduled_enq] || Sidekiq::Scheduled::Enq).new
74
+ def initialize(options)
75
+ @config = options
76
+ @enq = (options[:scheduled_enq] || Sidekiq::Scheduled::Enq).new
76
77
  @sleeper = ConnectionPool::TimedStack.new
77
78
  @done = false
78
79
  @thread = nil
@@ -100,7 +101,7 @@ module Sidekiq
100
101
  enqueue
101
102
  wait
102
103
  end
103
- Sidekiq.logger.info("Scheduler exiting...")
104
+ logger.info("Scheduler exiting...")
104
105
  }
105
106
  end
106
107
 
@@ -171,14 +172,14 @@ module Sidekiq
171
172
  #
172
173
  # We only do this if poll_interval_average is unset (the default).
173
174
  def poll_interval_average
174
- Sidekiq.options[:poll_interval_average] ||= scaled_poll_interval
175
+ @config[:poll_interval_average] ||= scaled_poll_interval
175
176
  end
176
177
 
177
178
  # Calculates an average poll interval based on the number of known Sidekiq processes.
178
179
  # This minimizes a single point of failure by dispersing check-ins but without taxing
179
180
  # Redis if you run many Sidekiq processes.
180
181
  def scaled_poll_interval
181
- process_count * Sidekiq.options[:average_scheduled_poll_interval]
182
+ process_count * @config[:average_scheduled_poll_interval]
182
183
  end
183
184
 
184
185
  def process_count
@@ -197,7 +198,7 @@ module Sidekiq
197
198
  # to give time for the heartbeat to register (if the poll interval is going to be calculated by the number
198
199
  # of workers), and 5 random seconds to ensure they don't all hit Redis at the same time.
199
200
  total = 0
200
- total += INITIAL_WAIT unless Sidekiq.options[:poll_interval_average]
201
+ total += INITIAL_WAIT unless @config[:poll_interval_average]
201
202
  total += (5 * rand)
202
203
 
203
204
  @sleeper.pop(total)
@@ -188,7 +188,7 @@ module Sidekiq
188
188
  end
189
189
 
190
190
  def clear_for(queue, klass)
191
- jobs_by_queue[queue].clear
191
+ jobs_by_queue[queue.to_s].clear
192
192
  jobs_by_class[klass].clear
193
193
  end
194
194
 
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "securerandom"
4
+ require "sidekiq/client"
5
+
6
+ module Sidekiq
7
+ class TransactionAwareClient
8
+ def initialize(redis_pool)
9
+ @redis_client = Client.new(redis_pool)
10
+ end
11
+
12
+ def push(item)
13
+ # pre-allocate the JID so we can return it immediately and
14
+ # save it to the database as part of the transaction.
15
+ item["jid"] ||= SecureRandom.hex(12)
16
+ AfterCommitEverywhere.after_commit { @redis_client.push(item) }
17
+ item["jid"]
18
+ end
19
+
20
+ ##
21
+ # We don't provide transactionality for push_bulk because we don't want
22
+ # to hold potentially hundreds of thousands of job records in memory due to
23
+ # a long running enqueue process.
24
+ def push_bulk(items)
25
+ @redis_client.push_bulk(items)
26
+ end
27
+ end
28
+ end
29
+
30
+ ##
31
+ # Use `Sidekiq.transactional_push!` in your sidekiq.rb initializer
32
+ module Sidekiq
33
+ def self.transactional_push!
34
+ begin
35
+ require "after_commit_everywhere"
36
+ rescue LoadError
37
+ Sidekiq.logger.error("You need to add after_commit_everywhere to your Gemfile to use Sidekiq's transactional client")
38
+ raise
39
+ end
40
+
41
+ default_job_options["client_class"] = Sidekiq::TransactionAwareClient
42
+ Sidekiq::JobUtil::TRANSIENT_ATTRIBUTES << "client_class"
43
+ true
44
+ end
45
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "6.4.2"
4
+ VERSION = "6.5.0"
5
5
  end
@@ -301,7 +301,7 @@ module Sidekiq
301
301
  end
302
302
 
303
303
  def environment_title_prefix
304
- environment = Sidekiq.options[:environment] || ENV["APP_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
304
+ environment = Sidekiq[:environment] || ENV["APP_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
305
305
 
306
306
  "[#{environment.upcase}] " unless environment == "production"
307
307
  end
@@ -359,7 +359,8 @@ module Sidekiq
359
359
 
360
360
  def build_client # :nodoc:
361
361
  pool = Thread.current[:sidekiq_via_pool] || get_sidekiq_options["pool"] || Sidekiq.redis_pool
362
- Sidekiq::Client.new(pool)
362
+ client_class = get_sidekiq_options["client_class"] || Sidekiq::Client
363
+ client_class.new(pool)
363
364
  end
364
365
  end
365
366
  end
data/lib/sidekiq.rb CHANGED
@@ -5,6 +5,7 @@ fail "Sidekiq #{Sidekiq::VERSION} does not support Ruby versions below 2.5.0." i
5
5
 
6
6
  require "sidekiq/logger"
7
7
  require "sidekiq/client"
8
+ require "sidekiq/transaction_aware_client"
8
9
  require "sidekiq/worker"
9
10
  require "sidekiq/job"
10
11
  require "sidekiq/redis_connection"
@@ -52,19 +53,79 @@ module Sidekiq
52
53
  puts "Calm down, yo."
53
54
  end
54
55
 
56
+ # config.concurrency = 5
57
+ def self.concurrency=(val)
58
+ self[:concurrency] = Integer(val)
59
+ end
60
+
61
+ # config.queues = %w( high default low ) # strict
62
+ # config.queues = %w( high,3 default,2 low,1 ) # weighted
63
+ # config.queues = %w( feature1,1 feature2,1 feature3,1 ) # random
64
+ #
65
+ # With weighted priority, queue will be checked first (weight / total) of the time.
66
+ # high will be checked first (3/6) or 50% of the time.
67
+ # I'd recommend setting weights between 1-10. Weights in the hundreds or thousands
68
+ # are ridiculous and unnecessarily expensive. You can get random queue ordering
69
+ # by explicitly setting all weights to 1.
70
+ def self.queues=(val)
71
+ self[:queues] = Array(val).each_with_object([]) do |qstr, memo|
72
+ name, weight = qstr.split(",")
73
+ self[:strict] = false if weight.to_i > 0
74
+ [weight.to_i, 1].max.times do
75
+ memo << name
76
+ end
77
+ end
78
+ end
79
+
80
+ ### Private APIs
81
+ def self.default_error_handler(ex, ctx)
82
+ logger.warn(dump_json(ctx)) unless ctx.empty?
83
+ logger.warn("#{ex.class.name}: #{ex.message}")
84
+ logger.warn(ex.backtrace.join("\n")) unless ex.backtrace.nil?
85
+ end
86
+
87
+ @config = DEFAULTS.dup
55
88
  def self.options
56
- @options ||= DEFAULTS.dup
89
+ logger.warn "`config.options[:key] = value` is deprecated, use `config[:key] = value`: #{caller(1..2)}"
90
+ @config
57
91
  end
58
92
 
59
93
  def self.options=(opts)
60
- @options = opts
94
+ logger.warn "config.options = hash` is deprecated, use `config.merge!(hash)`: #{caller(1..2)}"
95
+ @config = opts
96
+ end
97
+
98
+ def self.[](key)
99
+ @config[key]
100
+ end
101
+
102
+ def self.[]=(key, val)
103
+ @config[key] = val
104
+ end
105
+
106
+ def self.merge!(hash)
107
+ @config.merge!(hash)
108
+ end
109
+
110
+ def self.fetch(*args, &block)
111
+ @config.fetch(*args, &block)
112
+ end
113
+
114
+ def self.handle_exception(ex, ctx = {})
115
+ self[:error_handlers].each do |handler|
116
+ handler.call(ex, ctx)
117
+ rescue => ex
118
+ logger.error "!!! ERROR HANDLER THREW AN ERROR !!!"
119
+ logger.error ex
120
+ logger.error ex.backtrace.join("\n") unless ex.backtrace.nil?
121
+ end
61
122
  end
123
+ ###
62
124
 
63
125
  ##
64
126
  # Configuration for Sidekiq server, use like:
65
127
  #
66
128
  # Sidekiq.configure_server do |config|
67
- # config.redis = { :namespace => 'myapp', :size => 25, :url => 'redis://myhost:8877/0' }
68
129
  # config.server_middleware do |chain|
69
130
  # chain.add MyServerHook
70
131
  # end
@@ -77,7 +138,7 @@ module Sidekiq
77
138
  # Configuration for Sidekiq client, use like:
78
139
  #
79
140
  # Sidekiq.configure_client do |config|
80
- # config.redis = { :namespace => 'myapp', :size => 1, :url => 'redis://myhost:8877/0' }
141
+ # config.redis = { size: 1, url: 'redis://myhost:8877/0' }
81
142
  # end
82
143
  def self.configure_client
83
144
  yield self unless server?
@@ -93,7 +154,7 @@ module Sidekiq
93
154
  retryable = true
94
155
  begin
95
156
  yield conn
96
- rescue Redis::BaseError => ex
157
+ rescue RedisConnection.adapter::BaseError => ex
97
158
  # 2550 Failover can cause the server to become a replica, need
98
159
  # to disconnect and reopen the socket to get back to the primary.
99
160
  # 4495 Use the same logic if we have a "Not enough replicas" error from the primary
@@ -118,7 +179,7 @@ module Sidekiq
118
179
  else
119
180
  conn.info
120
181
  end
121
- rescue Redis::CommandError => ex
182
+ rescue RedisConnection.adapter::CommandError => ex
122
183
  # 2850 return fake version when INFO command has (probably) been renamed
123
184
  raise unless /unknown command/.match?(ex.message)
124
185
  FAKE_INFO
@@ -126,19 +187,19 @@ module Sidekiq
126
187
  end
127
188
 
128
189
  def self.redis_pool
129
- @redis ||= Sidekiq::RedisConnection.create
190
+ @redis ||= RedisConnection.create
130
191
  end
131
192
 
132
193
  def self.redis=(hash)
133
194
  @redis = if hash.is_a?(ConnectionPool)
134
195
  hash
135
196
  else
136
- Sidekiq::RedisConnection.create(hash)
197
+ RedisConnection.create(hash)
137
198
  end
138
199
  end
139
200
 
140
201
  def self.client_middleware
141
- @client_chain ||= Middleware::Chain.new
202
+ @client_chain ||= Middleware::Chain.new(self)
142
203
  yield @client_chain if block_given?
143
204
  @client_chain
144
205
  end
@@ -150,7 +211,7 @@ module Sidekiq
150
211
  end
151
212
 
152
213
  def self.default_server_middleware
153
- Middleware::Chain.new
214
+ Middleware::Chain.new(self)
154
215
  end
155
216
 
156
217
  def self.default_worker_options=(hash) # deprecated
@@ -179,7 +240,7 @@ module Sidekiq
179
240
  # end
180
241
  # end
181
242
  def self.death_handlers
182
- options[:death_handlers]
243
+ self[:death_handlers]
183
244
  end
184
245
 
185
246
  def self.load_json(string)
@@ -209,7 +270,7 @@ module Sidekiq
209
270
 
210
271
  def self.logger=(logger)
211
272
  if logger.nil?
212
- self.logger.fatal!
273
+ self.logger.level = Logger::FATAL
213
274
  return self.logger
214
275
  end
215
276
 
@@ -232,7 +293,7 @@ module Sidekiq
232
293
  #
233
294
  # See sidekiq/scheduled.rb for an in-depth explanation of this value
234
295
  def self.average_scheduled_poll_interval=(interval)
235
- options[:average_scheduled_poll_interval] = interval
296
+ self[:average_scheduled_poll_interval] = interval
236
297
  end
237
298
 
238
299
  # Register a proc to handle any error which occurs within the Sidekiq process.
@@ -243,7 +304,7 @@ module Sidekiq
243
304
  #
244
305
  # The default error handler logs errors to Sidekiq.logger.
245
306
  def self.error_handlers
246
- options[:error_handlers]
307
+ self[:error_handlers]
247
308
  end
248
309
 
249
310
  # Register a block to run at a point in the Sidekiq lifecycle.
@@ -256,12 +317,12 @@ module Sidekiq
256
317
  # end
257
318
  def self.on(event, &block)
258
319
  raise ArgumentError, "Symbols only please: #{event}" unless event.is_a?(Symbol)
259
- raise ArgumentError, "Invalid event name: #{event}" unless options[:lifecycle_events].key?(event)
260
- options[:lifecycle_events][event] << block
320
+ raise ArgumentError, "Invalid event name: #{event}" unless self[:lifecycle_events].key?(event)
321
+ self[:lifecycle_events][event] << block
261
322
  end
262
323
 
263
324
  def self.strict_args!(mode = :raise)
264
- options[:on_complex_arguments] = mode
325
+ self[:on_complex_arguments] = mode
265
326
  end
266
327
 
267
328
  # We are shutting down Sidekiq but what about threads that
@@ -8,6 +8,7 @@
8
8
  History: Histórico
9
9
  Busy: Ocupados
10
10
  Processed: Processados
11
+ Utilization: Utilização
11
12
  Failed: Falhas
12
13
  Scheduled: Agendados
13
14
  Retries: Tentativas
@@ -26,18 +27,20 @@
26
27
  Delete: Apagar
27
28
  AddToQueue: Adicionar à fila
28
29
  AreYouSureDeleteJob: Deseja deletar esta tarefa?
29
- AreYouSureDeleteQueue: Deseja deletar a %{queue} fila?
30
+ AreYouSureDeleteQueue: Deseja deletar a fila %{queue}? Isso irá deletar todas as tarefas desta fila.
30
31
  Queues: Filas
31
32
  Size: Tamanho
32
33
  Actions: Ações
33
34
  NextRetry: Próxima Tentativa
34
35
  RetryCount: Número de Tentativas
35
36
  RetryNow: Tentar novamente agora
37
+ Kill: Matar
36
38
  LastRetry: Última tentativa
37
39
  OriginallyFailed: Falhou originalmente
38
40
  AreYouSure: Tem certeza?
39
41
  DeleteAll: Apagar tudo
40
42
  RetryAll: Tentar tudo novamente
43
+ KillAll: Matar todas
41
44
  NoRetriesFound: Nenhuma tentativa encontrada
42
45
  Error: Erro
43
46
  ErrorClass: Classe de erro
@@ -58,11 +61,26 @@
58
61
  OneMonth: 1 mês
59
62
  ThreeMonths: 3 meses
60
63
  SixMonths: 6 meses
61
- Failures : Falhas
62
- DeadJobs : Tarefas mortas
63
- NoDeadJobsFound : Nenhuma tarefa morta foi encontrada
64
- Dead : Morta
65
- Processes : Processos
66
- Thread : Thread
67
- Threads : Threads
68
- Jobs : Tarefas
64
+ Failures: Falhas
65
+ DeadJobs: Tarefas mortas
66
+ NoDeadJobsFound: Nenhuma tarefa morta foi encontrada
67
+ Dead: Morta
68
+ Process: Processo
69
+ Processes: Processos
70
+ Name: Nome
71
+ Thread: Thread
72
+ Threads: Threads
73
+ Jobs: Tarefas
74
+ Paused: Pausado
75
+ Stop: Parar
76
+ Quiet: Silenciar
77
+ StopAll: Parar Todos
78
+ QuietAll: Silenciar Todos
79
+ PollingInterval: Intervalo de Polling
80
+ Plugins: Plug-ins
81
+ NotYetEnqueued: Ainda não enfileirado
82
+ CreatedAt: Criado em
83
+ BackToApp: De volta ao aplicativo
84
+ Latency: Latência
85
+ Pause: Pausar
86
+ Unpause: Despausar
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.4.2
4
+ version: 6.5.0
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-04-19 00:00:00.000000000 Z
11
+ date: 2022-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -75,8 +75,8 @@ files:
75
75
  - lib/sidekiq/api.rb
76
76
  - lib/sidekiq/cli.rb
77
77
  - lib/sidekiq/client.rb
78
+ - lib/sidekiq/component.rb
78
79
  - lib/sidekiq/delay.rb
79
- - lib/sidekiq/exception_handler.rb
80
80
  - lib/sidekiq/extensions/action_mailer.rb
81
81
  - lib/sidekiq/extensions/active_record.rb
82
82
  - lib/sidekiq/extensions/class_methods.rb
@@ -92,17 +92,20 @@ files:
92
92
  - lib/sidekiq/middleware/chain.rb
93
93
  - lib/sidekiq/middleware/current_attributes.rb
94
94
  - lib/sidekiq/middleware/i18n.rb
95
+ - lib/sidekiq/middleware/modules.rb
95
96
  - lib/sidekiq/monitor.rb
96
97
  - lib/sidekiq/paginator.rb
97
98
  - lib/sidekiq/processor.rb
98
99
  - lib/sidekiq/rails.rb
100
+ - lib/sidekiq/redis_client_adapter.rb
99
101
  - lib/sidekiq/redis_connection.rb
102
+ - lib/sidekiq/ring_buffer.rb
100
103
  - lib/sidekiq/scheduled.rb
101
104
  - lib/sidekiq/sd_notify.rb
102
105
  - lib/sidekiq/systemd.rb
103
106
  - lib/sidekiq/testing.rb
104
107
  - lib/sidekiq/testing/inline.rb
105
- - lib/sidekiq/util.rb
108
+ - lib/sidekiq/transaction_aware_client.rb
106
109
  - lib/sidekiq/version.rb
107
110
  - lib/sidekiq/web.rb
108
111
  - lib/sidekiq/web/action.rb
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "sidekiq"
4
-
5
- module Sidekiq
6
- module ExceptionHandler
7
- class Logger
8
- def call(ex, ctx)
9
- Sidekiq.logger.warn(Sidekiq.dump_json(ctx)) unless ctx.empty?
10
- Sidekiq.logger.warn("#{ex.class.name}: #{ex.message}")
11
- Sidekiq.logger.warn(ex.backtrace.join("\n")) unless ex.backtrace.nil?
12
- end
13
-
14
- Sidekiq.error_handlers << Sidekiq::ExceptionHandler::Logger.new
15
- end
16
-
17
- def handle_exception(ex, ctx = {})
18
- Sidekiq.error_handlers.each do |handler|
19
- handler.call(ex, ctx)
20
- rescue => ex
21
- Sidekiq.logger.error "!!! ERROR HANDLER THREW AN ERROR !!!"
22
- Sidekiq.logger.error ex
23
- Sidekiq.logger.error ex.backtrace.join("\n") unless ex.backtrace.nil?
24
- end
25
- end
26
- end
27
- end