Sha256: cdb3a20875fa3281eb0afd4bca185185a88ac9d2c70d4baaa2bdf89d95d70fca
Contents?: true
Size: 548 Bytes
Versions: 1
Compression:
Stored size: 548 Bytes
Contents
require 'metaractor' require 'excon' module ConsulStockpile class DetectConsul include Metaractor URL = 'http://127.0.0.1:8500/v1/agent/self'.freeze def call running = true begin Excon.get( URL, expects: [200], connect_timeout: 5, read_timeout: 5, write_timeout: 5, tcp_nodelay: true ) rescue Excon::Errors::SocketError, Excon::Errors::HTTPStatusError running = false end context.running = running end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
consul_stockpile-0.1.5 | lib/consul_stockpile/detect_consul.rb |