Method: Sensu::Server::Process#setup_connections

Defined in:
lib/sensu/server/process.rb

#setup_connections { ... } ⇒ Object

Set up the Redis and Transport connection objects, ‘@redis` and `@transport`. This method updates the Redis on error callback to reset the in progress check result counter. This method “drys” up many instances of `setup_redis()` and `setup_transport()`, particularly in the specs.

Yields:

  • callback/block called after connecting to Redis and the Sensu Transport.



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/sensu/server/process.rb', line 62

def setup_connections
  setup_redis do
    @redis.on_error do |error|
      @logger.error("redis connection error", :error => error.to_s)
      @in_progress[:check_results] = 0
    end
    setup_transport do
      yield
    end
  end
end