lib/sensu/api/http_handler.rb
# Determine if the API is connected to Redis and the Transport.
# This method sets the `@response_content` if the API is not
# connected or it has not yet initialized the connection
# objects. The `/info` and `/health` routes are excluded from
# the connectivity checks.
Determine if the API is connected to Redis and the Transport.
This method sets the `@response_content` if the API is not
connected or it has not yet initialized the connection
objects. The `/info` and `/health` routes are excluded from
the connectivity checks.
Determine if the API is connected to Redis and the Transport . This method sets the ` @response_content ` if the API is not connected or it has not yet initialized the connection objects . The ` / info ` and ` / health ` routes are excluded from the connectivity checks .
def connected?
        connected = true
        if @redis && @transport
          unless @http_request_uri =~ INFO_URI || @http_request_uri =~ HEALTH_URI
            unless @redis.connected?
              @response_content = {:error => "not connected to redis"}
              connected = false
            end
            unless @transport.connected?
              @response_content = {:error => "not connected to transport"}
              connected = false
            end
          end
        else
          @response_content = {:error => "redis and transport connections not initialized"}
          connected = false
        end
        connected
      end
def connected? connected = true if @redis && @transport unless @http_request_uri =~ INFO_URI || @http_request_uri =~ HEALTH_URI unless @redis . connected? @response_content = { :error => "not connected to redis" } connected = false end unless @transport . connected? @response_content = { :error => "not connected to transport" } connected = false end end else @response_content = { :error => "redis and transport connections not initialized" } connected = false end connected end
Determine if the API is connected to Redis and the Transport.
Determine if the API is connected to Redis and the Transport .