Class: OkComputer::Neo4jCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/ok_computer/built_in_checks/neo4j_check.rb

Constant Summary

Constants inherited from Check

Check::CheckNotDefined

Instance Attribute Summary

Attributes inherited from Check

#failure_occurred, #message, #registrant_name, #time

Instance Method Summary collapse

Methods inherited from Check

#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking

Instance Method Details

#checkObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ok_computer/built_in_checks/neo4j_check.rb', line 3

def check
  begin
    #Checks the connection for a 200
    connected = Neo4j::Session.current.connection.head.success?
    url = Neo4j::Session.current.connection.url_prefix.to_s
    mark_message "Connected to neo4j on #{url}" if connected
  rescue Faraday::ConnectionFailed => e
    mark_failure
    mark_message "Error: #{e.message}"
  end
end