sidekiq.rb 938 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # frozen_string_literal: true
  2. require_relative '../../lib/mastodon/sidekiq_middleware'
  3. Sidekiq.configure_server do |config|
  4. config.redis = REDIS_SIDEKIQ_PARAMS
  5. config.server_middleware do |chain|
  6. chain.add Mastodon::SidekiqMiddleware
  7. end
  8. config.server_middleware do |chain|
  9. chain.add SidekiqUniqueJobs::Middleware::Server
  10. end
  11. config.client_middleware do |chain|
  12. chain.add SidekiqUniqueJobs::Middleware::Client
  13. end
  14. SidekiqUniqueJobs::Server.configure(config)
  15. end
  16. Sidekiq.configure_client do |config|
  17. config.redis = REDIS_SIDEKIQ_PARAMS
  18. config.client_middleware do |chain|
  19. chain.add SidekiqUniqueJobs::Middleware::Client
  20. end
  21. end
  22. Sidekiq.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)
  23. SidekiqUniqueJobs.configure do |config|
  24. config.reaper = :ruby
  25. config.reaper_count = 1000
  26. config.reaper_interval = 600
  27. config.reaper_timeout = 150
  28. end