Skip to content

Commit

Permalink
Make Launcher#close_binder_listeners public
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schneems committed Jun 7, 2019
1 parent 8c78ee2 commit 84ce04d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/puma/cluster.rb
Expand Up @@ -411,7 +411,7 @@ def setup_signals
log "Early termination of worker"
exit! 0
else
@launcher.send(:close_binder_listeners)
@launcher.close_binder_listeners

stop_workers
stop
Expand Down
19 changes: 9 additions & 10 deletions lib/puma/launcher.rb
Expand Up @@ -214,6 +214,15 @@ def restart_args
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
Expand Down Expand Up @@ -319,16 +328,6 @@ def prune_bundler?
@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
Expand Down

0 comments on commit 84ce04d

Please sign in to comment.