mirror of
https://github.com/ditkrg/rabbit_carrots.git
synced 2026-01-22 13:56:41 +00:00
Refactors process ID handling in Rabbit Carrots plugin to use $$ instead of $PROCESS_ID for improved compatibility
This commit is contained in:
parent
cb41e257fc
commit
ac06deb86a
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user