2015-05-05 03:10:25 +02:00
|
|
|
if Rails.env.staging?
|
2016-03-23 18:39:41 +01:00
|
|
|
namespace = "fablab_staging"
|
2015-05-05 03:10:25 +02:00
|
|
|
else
|
2016-03-23 18:39:41 +01:00
|
|
|
namespace = "fablab"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
redis_host = ENV["REDIS_HOST"] || 'localhost'
|
|
|
|
redis_url = "redis://#{redis_host}:6379"
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
Sidekiq.configure_server do |config|
|
2016-03-23 18:39:41 +01:00
|
|
|
config.redis = { url: redis_url, namespace: namespace }
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
# load sidekiq-cron schedule config
|
|
|
|
schedule_file = "config/schedule.yml"
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
if File.exists?(schedule_file)
|
|
|
|
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
|
|
|
|
end
|
|
|
|
end
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
Sidekiq.configure_client do |config|
|
|
|
|
config.redis = { url: redis_url, namespace: namespace }
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|