AnkitG AnkitG - 22 days ago 6
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)
begin
#Some logic in it .....
end
end


Called from a file lib/parse_excel.rb

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


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


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

Answer

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.

Comments