test/support/apps/sidekiq/worker.rb in instana-1.211.0 vs test/support/apps/sidekiq/worker.rb in instana-1.212.0
- old
+ new
@@ -10,18 +10,18 @@
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
+cli = ::Sidekiq::CLI.instance
+cli.parse(['sidekiq', '-r', __FILE__, '-C', "#{File.dirname(__FILE__)}/config.yaml"])
+
+config_or_options = if sidekiq_version >= Gem::Version.new('6.5.0')
+ cli.config
+ else
+ cli.send :options
+ end
sidekiq_thread = Thread.new do
launcher = ::Sidekiq::Launcher.new(
config_or_options
)