verify!()
public
Checks whether the connection to the database is still active (i.e. not
stale). This is done under the hood by calling #active?.
If the connection is no longer active, then this method will reconnect
to the database.
Show source
def verify!
unless active?
if @unconfigured_connection
@lock.synchronize do
if @unconfigured_connection
@raw_connection = @unconfigured_connection
@unconfigured_connection = nil
configure_connection
@verified = true
return
end
end
end
reconnect!(restore_transactions: true)
end
@verified = true
end