You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
566 B
26 lines
566 B
module SidekiqAddOns |
|
def flushdb |
|
Sidekiq.redis(&:flushdb) |
|
end |
|
end |
|
Sidekiq.send(:extend, SidekiqAddOns) unless Sidekiq.respond_to?(:flushdb) |
|
|
|
opts = {} |
|
opts[:url] = ENV["REDIS_URL"] if ENV.key?("REDIS_URL") |
|
|
|
if opts.key?(:url) |
|
Sidekiq.configure_server do |config| |
|
config.redis = opts |
|
end |
|
|
|
Sidekiq.configure_client do |config| |
|
config.redis = opts |
|
end |
|
|
|
ActiveJob::Base.queue_adapter = :sidekiq unless Rails.env.test? |
|
end |
|
|
|
Sidekiq.default_worker_options = { |
|
unique: :until_executing, |
|
unique_args: ->(args) { args.first.except("job_id") } |
|
}
|
|
|