mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Disable inheriting connections on restart on windows. Fixes #166
This commit is contained in:
parent
9338e50499
commit
ba025fbebb
1 changed files with 20 additions and 0 deletions
|
@ -365,6 +365,26 @@ module Puma
|
|||
|
||||
require 'puma/jruby_restart'
|
||||
JRubyRestart.chdir_exec(@restart_dir, restart_args)
|
||||
|
||||
elsif windows?
|
||||
@binder.listeners.each_with_index do |(str,io),i|
|
||||
io.close
|
||||
|
||||
# We have to unlink a unix socket path that's not being used
|
||||
uri = URI.parse str
|
||||
if uri.scheme == "unix"
|
||||
path = "#{uri.host}#{uri.path}"
|
||||
File.unlink path
|
||||
end
|
||||
end
|
||||
|
||||
argv = restart_args
|
||||
|
||||
Dir.chdir @restart_dir
|
||||
|
||||
argv += [redirects] unless RUBY_VERSION < '1.9'
|
||||
Kernel.exec(*argv)
|
||||
|
||||
else
|
||||
redirects = {:close_others => true}
|
||||
@binder.listeners.each_with_index do |(l,io),i|
|
||||
|
|
Loading…
Reference in a new issue