Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

How can I ensure Sidekiq background jobs run against the database connection they were initiated from

$
0
0

I have been implementing horizontal database sharding in Rails 6.1 using the new native multiple database connection switching. This has worked great in general, but I am trying to find the best way ensure that background jobs (via Sidekiq backed by a shared Redis DB) are run against the database connection they were initiated from.

If I was using an older solution to horizontal sharding like Apartment, the https://github.com/influitive/apartment-sidekiq gem would be exactly what I needed. However I cannot find any solutions on how to do something similar with Rails's new native functionality.

What is the best way to accomplish this?


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>