-
I'm using 7.0.4 and I'm getting messages like this printed all over the place:
The messages show when I am running Rspec tests and are directly printed to Rspec's STDOUT. They don't appear in the Rails logfile. How do I turn these off? I see that this behavior was changed from 6.x to improve debugging, but I don't need them at the moment. My Sidekiq config is: # frozen_string_literal: true
require 'sidekiq/api'
require 'prometheus_exporter/instrumentation'
Sidekiq.configure_server do |config|
config.redis = { url: ENV['REDIS_URL'] }
config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
config.on :startup do
PrometheusExporter::Instrumentation::ActiveRecord.start(
custom_labels: { type: "sidekiq" }, #optional params
config_labels: [:database, :host] #optional params
)
PrometheusExporter::Instrumentation::SidekiqQueue.start
PrometheusExporter::Instrumentation::Process.start type: 'sidekiq'
end
at_exit do
PrometheusExporter::Client.default.stop(wait_timeout_seconds: 10)
end
config.server_middleware do |chain|
chain.add PrometheusExporter::Instrumentation::Sidekiq
end
config.death_handlers << PrometheusExporter::Instrumentation::Sidekiq.death_handler
config.client_middleware do |chain|
chain.add SidekiqUniqueJobs::Middleware::Client
end
config.server_middleware do |chain|
chain.add SidekiqUniqueJobs::Middleware::Server
end
SidekiqUniqueJobs::Server.configure(config)
end
Sidekiq.configure_client do |config|
config.redis = { url: ENV['REDIS_URL'] }
config.client_middleware do |chain|
chain.add SidekiqUniqueJobs::Middleware::Client
end
end
# All job classes that should repeat.
repeat_job_classes = [
# TODO
]
# prevent dying jobs from littering uniqueness keys
Sidekiq.configure_server do |config|
config.death_handlers << lambda { |job, _ex|
if job['unique_digest']
SidekiqUniqueJobs::Digests.del(digest: job['unique_digest'])
end
}
end
# Use this to clear out all existing jobs,
# and then start the repeating jobs directly.
ss = Sidekiq::ScheduledSet.new
repeat_job_classes.each do |rjc|
ss.select { |retri| retri.klass == rjc.name }.each(&:delete)
rjc.perform_async
end My workers use:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Better turn off unique jobs for testing. Is a section about that in readme. |
Beta Was this translation helpful? Give feedback.
-
SidekiqUniqueJobs.configure do |config|
# disable verbose logging for testing
config.logger = Logger.new("/dev/null") if Rails.env.test?
end |
Beta Was this translation helpful? Give feedback.
#608 (reply in thread)