Class: Sunspot::SessionProxy::MasterSlaveWithFailoverSessionProxy

Inherits:
MasterSlaveSessionProxy
  • Object
show all
Defined in:
lib/sunspot/session_proxy/master_slave_with_failover_session_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exceptionObject

Returns the value of attribute exception.



4
5
6
# File 'lib/sunspot/session_proxy/master_slave_with_failover_session_proxy.rb', line 4

def exception
  @exception
end

Instance Method Details

#commitObject



6
7
8
9
10
# File 'lib/sunspot/session_proxy/master_slave_with_failover_session_proxy.rb', line 6

def commit
  with_exception_handling do
    master_session.commit
  end
end

#search(*types, &block) ⇒ Object



12
13
14
15
16
# File 'lib/sunspot/session_proxy/master_slave_with_failover_session_proxy.rb', line 12

def search(*types, &block)
  [slave_session, master_session].any? do |session|
    with_exception_handling { session.search(*types, &block) }
  end or raise(exception)
end