我正在Rails应用程序中运行Sidekiq,以处理后台作业。
sidekiq.yml
:verbose: false
:pidfile: ./tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log
:concurrency: 5
:queues:
- ["queue1", 1]
- ["queue2", 1]
- ["queue3", 1]
- ["queue4", 1]
- ["queue5", 1]
- critical
- default
- low
max_retries: 1
ps aux | grep sidekiq
root 48 0.0 0.0 4400 1264 ? Ss 13:06 0:00 runsv sidekiq
root 15753 1.0 0.0 4628 924 ? S 13:14 0:00 /bin/sh /root/app/config/docker/sidekiq.sh
root 15754 35.0 0.0 78136 11408 ? R 13:14 0:00 ruby /usr/local/rvm/gems/ruby-2.6.2/bin/ruby_executable_hooks /usr/local/rvm/gems/ruby-2.6.2/bin/sidekiq -C config/sidekiq.yml -e qa -L log/sidekiq.log
Sidekiq可以在本地环境中处理作业。但是,当我在质量保证环境中部署时,sidekiq作业将添加到队列中而不进行处理。
我能够在redis-cli中看到队列名称
我该如何处理队列中的作业?
版本:-
sidekiq 5.2.5
Rails 5.2.2
initializers / sidekiq.rb
redis_config = {
url: "redis://#{Rails.configuration.redis.fetch('host')}:#{Rails.configuration.redis.fetch('port')}/#{Rails.configuration.redis.fetch('db')}",
namespace: "myapp"
}
Sidekiq.configure_server do |config|
config.redis = redis_config
end
Sidekiq.configure_client do |config|
config.redis = redis_config
end