Sidekiq工人未触发 [英] Sidekiq worker not getting triggered

查看:70
本文介绍了Sidekiq工人未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在后台工作中使用 Sidekiq :

我有一个工作人员应用程序/workers/data_import_worker.rb

class DataImportWorker
 include Sidekiq::Worker
 sidekiq_options retry: false

  def perform(job_id,file_name)
    begin
    #Some logic in it .....
  end
 end

从文件lib/parse_excel.rb调用

  def parse_raw_data
      #job_id and #filename are defined bfr
      DataImportWorker.perform_async(job_id,filename)   
  end

一旦我从操作中触发它,便不会呼叫该工作程序.Redis在localhost:6379

As soon as i trigger it from my action the worker is not getting called.. Redis is running on localhost:6379

任何想法为什么一定要发生.环境是Linux.

Any idea why this must be happening. The Environment is Linux.

推荐答案

在Sidekiq运行时,我遇到了类似的问题,但是当我调用perform_async时,除了返回true之外,它什么都没做.

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

问题是 rspec-sidekiq 已添加到我的":development,:test "组中.我通过仅将 rspec-sidekiq 移至":test "组来解决此问题.

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.

这篇关于Sidekiq工人未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆