AnkitG AnkitG - 9 months ago 48
Ruby Question

Sidekiq worker not getting triggered

I am using Sidekiq for my background jobs:

I have a worker app/workers/data_import_worker.rb

class DataImportWorker
include Sidekiq::Worker
sidekiq_options retry: false

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

Called from a file lib/parse_excel.rb

def parse_raw_data
#job_id and #filename are defined bfr

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

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

Answer Source

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

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