Sha256: d1c1e7bc177176d6d290fcf52a4d0fe272f27c7afa829daf1dfdf3104ab7fbc9
Contents?: true
Size: 903 Bytes
Versions: 6
Compression:
Stored size: 903 Bytes
Contents
# frozen_string_literal: true require 'rack' module SidekiqAlive class Server class << self def run! handler = Rack::Handler.get(server) Signal.trap('TERM') { handler.shutdown } handler.run(self, Port: port, Host: host, AccessLog: [], Logger: SidekiqAlive.logger) end def host SidekiqAlive.config.host end def port SidekiqAlive.config.port end def path SidekiqAlive.config.path end def server SidekiqAlive.config.server end def call(env) if Rack::Request.new(env).path != path [404, {}, ['Not found']] elsif SidekiqAlive.alive? [200, {}, ['Alive!']] else response = "Can't find the alive key" SidekiqAlive.logger.error(response) [404, {}, [response]] end end end end end
Version data entries
6 entries across 6 versions & 2 rubygems