diff --git a/lib/puma/plugin/rabbit_carrots.rb b/lib/puma/plugin/rabbit_carrots.rb index 402d64c..e4301ea 100644 --- a/lib/puma/plugin/rabbit_carrots.rb +++ b/lib/puma/plugin/rabbit_carrots.rb @@ -8,7 +8,7 @@ Puma::Plugin.create do def start(launcher) @log_writer = launcher.log_writer - @puma_pid = $$ + @puma_pid = $PROCESS_ID @core_service = RabbitCarrots::Core.new(logger: log_writer) @@ -43,6 +43,7 @@ Puma::Plugin.create do Process.kill('TERM', rabbit_carrots_pid) Process.wait(rabbit_carrots_pid) rescue Errno::ECHILD, Errno::ESRCH + log 'Rabbit Carrots already stopped' end def monitor_puma @@ -57,7 +58,7 @@ Puma::Plugin.create do loop do if send(process_dead) log message - Process.kill('TERM', $$) + Process.kill('TERM', $PROCESS_ID) break end sleep 2 diff --git a/lib/rabbit_carrots/configuration.rb b/lib/rabbit_carrots/configuration.rb index e2308c0..acc7a9b 100644 --- a/lib/rabbit_carrots/configuration.rb +++ b/lib/rabbit_carrots/configuration.rb @@ -18,8 +18,8 @@ module RabbitCarrots :rabbitmq_exchange_name, :automatically_recover, :network_recovery_interval, - :recovery_attempts, - :orm + :recovery_attempts + def orm @orm ||= :activerecord end