Retrospring/config/initializers/15_sidekiq.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
530 B
Ruby
Raw Normal View History

require "rpush/daemon"
require "rpush/daemon/store/active_record"
require "rpush/client/active_record"
redis_url = ENV.fetch("REDIS_URL") { APP_CONFIG["redis_url"] }
2014-12-12 08:35:16 -08:00
Sidekiq.configure_server do |config|
config.redis = { url: redis_url }
Rpush.config.push = true
Rpush::Daemon.store = Rpush::Daemon::Store::ActiveRecord.new
Rpush::Daemon.common_init
Rpush::Daemon::Synchronizer.sync
at_exit do
Rpush::Daemon::AppRunner.stop
end
2014-12-12 08:35:16 -08:00
end
Sidekiq.configure_client do |config|
config.redis = { url: redis_url }
end