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"
|
||||
exit! 0
|
||||
else
|
||||
@launcher.send(:close_binder_listeners)
|
||||
@launcher.close_binder_listeners
|
||||
|
||||
stop_workers
|
||||
stop
|
||||
|
|
|
@ -214,6 +214,15 @@ module Puma
|
|||
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
|
||||
|
||||
def reload_worker_directory
|
||||
|
@ -319,16 +328,6 @@ module Puma
|
|||
@options[:prune_bundler] && clustered? && !@options[:preload_app]
|
||||
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
|
||||
if dir = @options[:directory]
|
||||
@restart_dir = dir
|
||||
|
|
Loading…
Reference in a new issue