test/support/apps/sidekiq/worker.rb in instana-1.209.8 vs test/support/apps/sidekiq/worker.rb in instana-1.210.0

- old
+ new

@@ -10,15 +10,22 @@ require_relative 'jobs/sidekiq_job_2' ::Instana.logger.info "Booting instrumented sidekiq worker for tests." ::Sidekiq.logger.level = ::Logger::FATAL +properties = {queues: ['important'], concurrency: 2} + +sidekiq_version = Gem::Specification.find_by_name('sidekiq').version +config_or_options = + if sidekiq_version >= Gem::Version.new('7.0.0') + ::Sidekiq::Config.new(Sidekiq.default_configuration.merge!(properties)) + else + ::Sidekiq.options.merge(properties) + end + sidekiq_thread = Thread.new do launcher = ::Sidekiq::Launcher.new( - ::Sidekiq.options.merge( - queues: ['important'], - concurrency: 2 - ) + config_or_options ) launcher.run Thread.current[:worker] = launcher end