Module: Sunspot::Rails::Failover

Defined in:
lib/sunspot-rails-failover.rb,
lib/sunspot-rails-failover/version.rb,
lib/sunspot-rails-failover/exception_handler_adapter.rb

Defined Under Namespace

Modules: ExceptionHandlerAdapter

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.exception_handlerObject

Returns the value of attribute exception_handler.



9
10
11
# File 'lib/sunspot-rails-failover.rb', line 9

def exception_handler
  @exception_handler
end

Class Method Details

.setupObject



11
12
13
14
15
16
17
18
19
# File 'lib/sunspot-rails-failover.rb', line 11

def setup
  Sunspot.session = if Sunspot::Rails.configuration.has_master?
    Sunspot::SessionProxy::MasterSlaveWithFailoverSessionProxy.new(
      Sunspot::Session.new(master_config), Sunspot::Session.new(slave_config)
    )
  else
    Sunspot::SessionProxy::ThreadLocalSessionProxy.new(slave_config)
  end
end