Questions tagged [sidekiq]

Sidekiq is a background processing framework for Ruby.

Sidekiq is a multi-threaded background job and message processing gem written by Mike Perham and is available on GitHub.

2372 questions
8
votes
2 answers

Sidekiq error Uninitialized Constant

I'm having an issue with sidekiq. Basically we're getting NameError: uninitialized constant on our sidekiq setup which is causing a large number of jobs to fail. The error log says: NameError: uninitialized constant…
roloenusa
  • 761
  • 1
  • 10
  • 19
7
votes
2 answers

Pipelining commands on a Redis instance is deprecated and will be removed in Redis 5.0.0

I am using redis version 6.0 and gem 'sidekiq', '>= 6.4.1' gem 'sidekiq-cron', '~> 1.2' for job scheduling in rails. I am using corn job to process email daily. [. My ruby version is 2.7, rails version is 6.1 and using ubuntu 20.07.
Sanju Basnet
  • 136
  • 2
  • 9
7
votes
1 answer

Sidekiq unique jobs with lock_expiration not working as intended

I'm having an issue with lock_expiration and sidekiq unique jobs. gem 'sidekiq', '4.2.10' gem 'sidekiq-cron', '1.2.0' gem 'sidekiq-unique-jobs', '6.0.25' With the sidekiq options of: sidekiq_options queue: :medium, retry: 3, lock: :until_executed,…
DickieBoy
  • 4,886
  • 1
  • 28
  • 47
7
votes
1 answer

ActiveJob + Sidekiq 6.0.3: How to write to a log file?

I'm using Sidekiq to get some background jobs done. I am also trying to log some messages from these jobs to a log file, but I have been unable to do this simple task. Example of the kind of job I'm running class TestJob < ApplicationJob queue_as…
hananamar
  • 1,166
  • 15
  • 25
7
votes
3 answers

Advantages when using ActiveJob with Sidekiq compare with Sidekiq alone

I'm reading some tutorials online that tell us using ActiveJob with Sidekiq. But I don't know why we should do that. I see that Sidekiq has all features that ActiveJob has. Moreover, on Sidekiq document: here Warning: by doing job retry through…
Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107
7
votes
2 answers

Rails ActiveJob - how to stop job from being enqueued in before_enqueue

I am running Rails 4.2.8 and I want to make my job only run under certain conditions. Currently I am doing that check in the code that is calling the job but it would be much cleaner to contain the logic in the job class. Has anyone done that? …
Dmitry Polyakovsky
  • 1,535
  • 11
  • 31
7
votes
2 answers

Default Sidekiq Redis configuration in Rails app

I'm trying to understand the Redis & Sidekiq configuration in a Passenger+Rails app and have run into some lack of understanding. I start the redis server independently of my rails app, while Sidekiq is a gem in my Rails app. I start it likewise:…
Sid
  • 4,893
  • 14
  • 55
  • 110
7
votes
2 answers

Rails: Sidekiq cannot find the created record

I am using sidekiq to run some job after creating a record. when the job tries to find the record with the created ID, there are random cases where it raises a RecordNotFound. how can this be possible? class Person def self.test_create p =…
Yeonho
  • 3,629
  • 4
  • 39
  • 61
7
votes
2 answers

How to get sidekiq retry_count from inside a job

I am trying to send an alert every time retry_count of a sidekiq job reaches 5(to warn an engineer to check why the worker is failing) and then continued being retried as usual. Is there a way to get the retry count for a particular job from inside…
Totic
  • 1,281
  • 1
  • 10
  • 21
7
votes
1 answer

Value gets set even though before_save sets it to nil

I am using the aasm_state gem, along with sidekiq. Here's what customer.rb looks like for the definition of aasm_state: aasm do state :closed, initial: true state :open state :claimed event :open do transitions from:…
Matthew Berman
  • 8,481
  • 10
  • 49
  • 98
7
votes
1 answer

Sustainable Solution To Configuring Rails, Sidekiq, Redis All On AWS Elastic Beanstalk

AWS Elastic Beanstalk rails app that needs a sidekiq worker processes running alongside Puma/Passenger. Getting the sidekiq process to run has resulted in hours failed attempts. Also, getting the rails app and sidekiq to talk to my AWS ElastiCache…
7
votes
1 answer

Sidekiq + Rails: How to see queue of "Busy" jobs?

I have a script that looks for jobs: Sidekiq::Queue.new(queue_name).any? { |q| q.args[0] == blah_id } || Sidekiq::RetrySet.new.any? { |r| r.queue == queue_name && r.args[0] == blah_id } || Sidekiq::ScheduledSet.new.any? { |s| s.queue == queue_name…
bigpotato
  • 26,262
  • 56
  • 178
  • 334
7
votes
3 answers

How to Wait for Parallel Sidekiq Workers to All Complete Before Calling Another Method?

I have several workers that are being run using Sidekiq and scheduled using Sidetiq. I'm looking for advice on the best way to wait for all workers to complete before executing a callback, similar to Sidekiq-Pro's batching functionality. Any advice…
AvocadoRivalry
  • 411
  • 1
  • 7
  • 16
7
votes
1 answer

Ruby On Rails : Sidekiq : Instance variable @organisation not available in mailer-layout

I have used sidekiq and redis-server to send email in background.. Problem: Its ok when used sync method to send email. i.e. in applicants_controller.rb UserMailer.notify_applicant_assignment(current_assigned_user.id, applicant,…
Shiva
  • 11,485
  • 2
  • 67
  • 84
7
votes
1 answer

sidekiq retries exhausted with arguments

I crawl leads from other sites and activate them at mine. With Sidekiq I run a HealthCheckerWorker every hour to deactivate the lead on my site unless it's still up and running on the other site. Sometimes the HealthCheckerWorker throws an error,…
davegson
  • 8,205
  • 4
  • 51
  • 71