From ac06deb86aa5d9fd6c349a912474a87d1191683b Mon Sep 17 00:00:00 2001 From: Ari Karim Date: Sun, 25 May 2025 15:14:30 +0300 Subject: [PATCH] Refactors process ID handling in Rabbit Carrots plugin to use $$ instead of $PROCESS_ID for improved compatibility --- lib/puma/plugin/rabbit_carrots.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/puma/plugin/rabbit_carrots.rb b/lib/puma/plugin/rabbit_carrots.rb index 79fd20f..3344c16 100644 --- a/lib/puma/plugin/rabbit_carrots.rb +++ b/lib/puma/plugin/rabbit_carrots.rb @@ -1,5 +1,4 @@ # rabbit_carrots.rb -require 'English' require 'puma/plugin' require 'rabbit_carrots' @@ -8,7 +7,7 @@ Puma::Plugin.create do def start(launcher) @log_writer = launcher.log_writer - @puma_pid = $PROCESS_ID + @puma_pid = $$ @core_service = RabbitCarrots::Core.new(logger: log_writer) @@ -58,7 +57,7 @@ Puma::Plugin.create do loop do if send(process_dead) log message - Process.kill('TERM', $PROCESS_ID) + Process.kill('TERM', $$) break end sleep 2