mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Make Launcher#close_binder_listeners public
To avoid a `send` call in `cluster.rb` and to indicate to the maintainers that other classes use this method, we will make it public.
This commit is contained in:
parent
8c78ee201e
commit
84ce04dc95
2 changed files with 10 additions and 11 deletions
|
@ -411,7 +411,7 @@ module Puma
|
||||||
log "Early termination of worker"
|
log "Early termination of worker"
|
||||||
exit! 0
|
exit! 0
|
||||||
else
|
else
|
||||||
@launcher.send(:close_binder_listeners)
|
@launcher.close_binder_listeners
|
||||||
|
|
||||||
stop_workers
|
stop_workers
|
||||||
stop
|
stop
|
||||||
|
|
|
@ -214,6 +214,15 @@ module Puma
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def close_binder_listeners
|
||||||
|
@binder.listeners.each do |l, io|
|
||||||
|
io.close
|
||||||
|
uri = URI.parse(l)
|
||||||
|
next unless uri.scheme == 'unix'
|
||||||
|
File.unlink("#{uri.host}#{uri.path}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def reload_worker_directory
|
def reload_worker_directory
|
||||||
|
@ -319,16 +328,6 @@ module Puma
|
||||||
@options[:prune_bundler] && clustered? && !@options[:preload_app]
|
@options[:prune_bundler] && clustered? && !@options[:preload_app]
|
||||||
end
|
end
|
||||||
|
|
||||||
def close_binder_listeners
|
|
||||||
@binder.listeners.each do |l, io|
|
|
||||||
io.close
|
|
||||||
uri = URI.parse(l)
|
|
||||||
next unless uri.scheme == 'unix'
|
|
||||||
File.unlink("#{uri.host}#{uri.path}")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def generate_restart_data
|
def generate_restart_data
|
||||||
if dir = @options[:directory]
|
if dir = @options[:directory]
|
||||||
@restart_dir = dir
|
@restart_dir = dir
|
||||||
|
|
Loading…
Add table
Reference in a new issue