Created
March 30, 2020 17:50
-
-
Save victorgiraldes/2e6062619c8dc06955d5abbee065aa26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sidekiq.configure_server do |config| | |
config.redis = { | |
db: 1, url: ENV.fetch('REDIS_URL'), namespace: "sidekiq_eagro_#{Rails.env}", size: Sidekiq.options[:concurrency] + 2 | |
} | |
config.on(:startup) do | |
Sidekiq.schedule = YAML.load_file(File.expand_path('../../sidekiq_scheduler.yml', __FILE__)) | |
SidekiqScheduler::Scheduler.instance.reload_schedule! | |
end | |
end | |
Sidekiq.configure_client do |config| | |
config.redis = { db: 1, url: ENV.fetch('REDIS_URL'), namespace: "sidekiq_eagro_#{Rails.env}" } | |
end | |
Sidekiq.default_worker_options = { backtrace: true } | |
if Rails.env.production? || Rails.env.staging? | |
require 'sidekiq/web' | |
Sidekiq::Web.use(Rack::Auth::Basic) do |user, password| | |
[user, password] == [ENV.fetch('SIDEKIQ_USER'), ENV.fetch('SIDEKIQ_PASSWORD')] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment