Sha256: d1ef0984f694f8333da14f5ff805e5d69537de0a072b2a535e4fc3f01da835c8
Contents?: true
Size: 910 Bytes
Versions: 5
Compression:
Stored size: 910 Bytes
Contents
module Appsignal class Hooks class PumaHook < Appsignal::Hooks::Hook register :puma def dependencies_present? defined?(::Puma) && ::Puma.respond_to?(:cli_config) && ::Puma.cli_config end def install ::Puma.cli_config.options[:before_worker_boot] ||= [] ::Puma.cli_config.options[:before_worker_boot] << proc do |_id| Appsignal.forked end ::Puma.cli_config.options[:before_worker_shutdown] ||= [] ::Puma.cli_config.options[:before_worker_shutdown] << proc do |_id| Appsignal.stop("puma before_worker_shutdown") end ::Puma::Cluster.class_eval do alias stop_workers_without_appsignal stop_workers def stop_workers Appsignal.stop("puma cluster") stop_workers_without_appsignal end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems