Closed sebgrebe closed 1 year ago
I was almost there. I eventually resolved this by adding the following line to config/initializers/active_job_uniqueness.rb
.
config.redlock_servers = [Redis.new(:url => ENV["REDIS_URL"], :ssl_params => { verify_mode: OpenSSL::SSL::VERIFY_NONE })]
Notice the use of Redis.new
rather than RedisClient.new
. I also had to remove 'redis://localhost:6379'
from the array of servers.
I am using activejob-uniqueness together with sidekiq as the background worker as well as redis, deployed on heroku. When using activejob-uniqueness with heroku redis on the mini plan, everything works fine. When using it with heroku redis on the premium-0 plan, I get the following error when trying to enqueue a job that is using activejob-uniqueness's
unique :until_executed
:I believe this is the case because on Heroku's premium-0 plan TLS is enforced. This is a known issue when using Sidekiq and Heroku and Heroku's recommendation is to configure the SSL connection to VERIFY_NONE:
In fact, when enqueuing other jobs that are not using activejob-uniqueness I do not see the described issue.
I assume the reason is that when activejob-uniqueness is initialised, the Redis configuration for Sidekiq is somehow ignored or overwritten.
I tried to fix this by setting a similar configuration in config/initializers/active_job_uniqueness.rb as follows:
but for this I get the following error: