Sidekiq worker not getting triggered

被刻印的时光 ゝ 提交于 2019-11-30 17:21:08
basgys

I had a similar problem where Sidekiq was running but when I called perform_async it didn't do anything except return true.

The problem was rspec-sidekiq was added to my ":development, :test" group. I fixed the problem by moving rspec-sidekiq to the ":test" group only.

Start sidekiq from the root directory of your Rails app. For example,

bundle exec sidekiq -e staging -C config/sidekiq.yml

I encounter the same problem, it turns out that the argument I've passed in the function perform_async is not appropriate, it seems that one should not pass any query result in perform_async, you must do all the query in the function perform.

You need to specify the name of the queue that worker is for.

Example: sidekiq_options retry: false, :queue => data_import_worker

data_import_worker can be any name you want to give it.

Then when you go to the web interface: yoursite.com/sidekiq, you'll be able to see the current workers for the queue "data_import_worker"

For me when doing a perform_later, it would enqueue but never remove from queue. I needed to add my queue name to the sidekiq.yml file

---
:concurrency: 25
:pidfile: ./tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log
:queues:
  - default
  - my_queue

Lost a good 15 min on this. To check if Sidekiq is correctly loading your config file (with the queues names), go to the web interface in the Busy tab and you'll find your Process ID and below it you'll find your queues.

In our case, we had misspelled mailer (the correct ActiveJob queue for Mailers is mailers, in plural).

My issue was simply having the worker file in the wrong path.

Needs to be in "project_root/app/worker/worker.rb", not "project_root/worker/worker.rb"

Check the file path!

is it realy run multiple workers on standalone sidekiq? for example I have 2 workers: ProccessWorker CallbackWorker

when I am runnigs sidekiq: bundle exec sidekiq -r ./workers/proccess_worker.rb -C ./config/sidekiq.yml

only one worker in same time.

I was calling perform_async(23) in a production console, however my sidekiq was started in staging mode.

After I started the Sidekiq in production mode, things have started working very well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!