Sha256: 03de472bb4b2d34636c993b4d571f5afbd07f99dcdd75ec9de90010b6e6ca173
Contents?: true
Size: 736 Bytes
Versions: 2
Compression:
Stored size: 736 Bytes
Contents
module Sunspot module SessionProxy class MasterSlaveWithFailoverSessionProxy < MasterSlaveSessionProxy attr_accessor :exception def commit with_exception_handling do master_session.commit end end def search(*types, &block) [slave_session, master_session].any? do |session| with_exception_handling { session.search(*types, &block) } end or raise(exception) end private def with_exception_handling yield rescue Exception => exception Sunspot::Rails::Failover::ExceptionHandlerAdapter.handle(exception) self.exception = exception false end end end end
Version data entries
2 entries across 2 versions & 1 rubygems