diff --git a/myapp/config/initializers/sidekiq.rb b/myapp/config/initializers/sidekiq.rb index caaf46f6f..ab4a3cf92 100644 --- a/myapp/config/initializers/sidekiq.rb +++ b/myapp/config/initializers/sidekiq.rb @@ -12,12 +12,6 @@ retry: true, } -Sidekiq.configure_client do |config| - config.client_middleware do |chain| - chain.add SidekiqUniqueJobs::Middleware::Client - end -end - Sidekiq.configure_client do |config| config.redis = { url: ENV["REDIS_URL"], driver: :hiredis } @@ -38,21 +32,18 @@ end SidekiqUniqueJobs::Server.configure(config) - - config.error_handlers << ->(ex, ctx_hash) { p ex, ctx_hash } end Sidekiq.logger = Sidekiq::Logger.new($stdout) Sidekiq.logger.level = :debug -Sidekiq.log_format = :json if Sidekiq.respond_to?(:log_format) +Sidekiq.log_format = :json if Sidekiq.respond_to?(:log_format) SidekiqUniqueJobs.configure do |config| - config.debug_lua = true - config.lock_info = true - config.logger = Sidekiq.logger - config.max_history = 10_000 - config.reaper = :lua - config.reaper_count = 100 - config.reaper_interval = 10 - config.reaper_timeout = 5 + config.debug_lua = false # true for debugging + config.lock_info = false # true for debugging + config.max_history = 1000 # keeps n number of changelog entries + config.reaper = :ruby # also :lua but that will lock while cleaning + config.reaper_count = 1000 # Reap maximum this many orphaned locks + config.reaper_interval = 10 # Reap every 10 seconds + config.reaper_timeout = 5 # Give the reaper 5 seonds to finish end Dir[Rails.root.join("app", "workers", "**", "*.rb")].sort.each { |worker| require worker }