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
16
votes
1 answer

What is difference between perform_in and perform_async in sidekiq?

I want to update old sidekiq jobs with new time interval. How I can do this ? Is it possible through perform_in option. In addition I want to know clear difference between perform_in and perform_async.
Prakash Laxkar
  • 824
  • 1
  • 8
  • 17
16
votes
1 answer

How to use Byebug with Sidekiq and Foreman

I have a rails application in which I use foreman to start my rails and sidekiq servers. Since foreman doesn't interact well with regular byebug (you can't see the prompt as you type), I have set up remote debugging for both my rails and sidekiq…
Tommy Steimel
  • 771
  • 8
  • 16
16
votes
1 answer

Move sidekiq job straight to dead queue

Is it possible to move sidekiq job straight to dead queue from SidekiqWorker instance level (i.e. while executing) class MyWorker include Sidekiq::Worker sidekiq_options retry: 9 def perform(name) if name == 'StackOverflow' # ---->…
Filip Bartuzi
  • 5,711
  • 7
  • 54
  • 102
16
votes
4 answers

Can't connect to redis on heroku

I'm using sidekiq with active_job in my rails application. The job currently works but I am unable to get connect to the Redis when deploying to heroku. In heroku I have the RedisToGo addon. When pushing to heroku I get the following error.…
Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188
16
votes
4 answers

How to control concurrency per queue?

Sidekiq documentation suggests I can only control the global concurrency of sidekiq, rather than per queue. I am raising a question here with hope that there's a solution for a per-queue concurrency setting. Some 3rd party services just won't accept…
Tal
  • 7,827
  • 6
  • 38
  • 61
16
votes
1 answer

configure redis auth on sidekiq

I think I am missing something since I couldn't find in the docs how to write the username and password for the redis instance to use with sidekiq.. Is there a way to do this? Or is it through ENV vars?
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
16
votes
3 answers

What is server and client terminology mean in Sidekiq?

In SideKiq the documention says Sidekiq.configure_server do |config| config.redis = {:namespace => "figs_#{Rails.env}", :size => 25, :url => 'redis://localhost:6379/0'} end Sidekiq.configure_client do |config| config.redis = {:namespace =>…
Sahil Grover
  • 1,862
  • 4
  • 26
  • 57
16
votes
3 answers

Run Delayed Jobs and Sidekiq at the same time

I currently use delayed job to process jobs asynchronously. Instead of creating workers, I use the .delay method a lot. I want to move to Sidekiq, but I have too many types of jobs, and can't make sure all of them are thread safe. So I want to run…
lulalala
  • 17,572
  • 15
  • 110
  • 169
15
votes
1 answer

Redis pub/sub on rails

Following the Redis Pub/Sub this works fine and i can publish messages in any class using $redis.publish 'channel', { object: @object.id } using redis-cli > MONITOR, I can verify that this request was published correctly [0 127.0.0.1:64192]…
a14m
  • 7,808
  • 8
  • 50
  • 67
15
votes
2 answers

multiple methods per sidekiq worker

I don't get it. Per Sidekiq documentation, each worker (mine is called FeedWorker) can only contain one method called perform. Well, what if I want to run mulitple methods through the same worker? For instance, my FeedWorker (you guessed it, it…
Laurent
  • 1,554
  • 19
  • 42
14
votes
4 answers

Sidekiq keeps yelling at CSRF protection, but the route is mounted inside Rails.application.routes.draw

I have a Rails 6.0.3.5 API, and i'm NOT using Devise for authentication. When I try to access sidekiq UI, it yells: Sidekiq::Web needs a valid Rack session for CSRF protection. If this is a Rails app, make sure you mount Sidekiq::Web *inside* your…
João Ramires
  • 723
  • 10
  • 23
14
votes
2 answers

How to debug Rails connection pool usage?

I'm running into issues with Sidekiq workers. ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5.000 seconds (waited 5.000 seconds) I am following recommendations about using ActiveRecord::ConnectionTimeoutError…
Joe
  • 46,419
  • 33
  • 155
  • 245
14
votes
0 answers

What is the difference between sidekiq perform and perform_async?

When running UserMailer.new.perform, my mailer is sent and I get an email almost right away, but when I use UserMailer.perform_async, it spits back an object number and I never receive an email. Can someone please tell me why this is happening and…
sclem72
  • 466
  • 6
  • 16
14
votes
3 answers

How to access perform parameters in ActiveJob rescue

I am wondering on how do you access ActiveJob perform parameters in the resue block, such as def perform object end rescue_from Exception do |e| if e.class != ActiveRecord::RecordNotFound **job.arguments.first** # do something …
14
votes
3 answers

redis attempting to connect to local host in Heroku - WHY?

I have been using sidekiq/redis for quite some time with no issues to date. For some reason, today I am getting this error: Redis::CannotConnectError - Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED): So, Redis is attempting to connect to…
Luigi
  • 5,443
  • 15
  • 54
  • 108