diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-15 08:32:54 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-15 10:54:09 +0900 |
commit | 2fa9f3c0322570dfb1672b49bc1f3306ef595131 (patch) | |
tree | bdb2889c822e634f931d27f2ca81c6192e6e5b0e /lib/bundler/vendor | |
parent | 7898f4243f5df9ead0bf91cc8c40907c559d18c0 (diff) | |
download | ruby-2fa9f3c0322570dfb1672b49bc1f3306ef595131.tar.gz |
Prepare to release rubygems-3.2.1 and bundler-2.2.1
Diffstat (limited to 'lib/bundler/vendor')
-rw-r--r-- | lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb index d0ab956faf..beff6d658b 100644 --- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb @@ -159,7 +159,14 @@ class Bundler::Persistent::Net::HTTP::Persistent # limits (typically windows). if Process.const_defined? :RLIMIT_NOFILE - DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4 + open_file_limits = Process.getrlimit(Process::RLIMIT_NOFILE) + + # Under JRuby on Windows Process responds to `getrlimit` but returns something that does not match docs + if open_file_limits.respond_to?(:first) + DEFAULT_POOL_SIZE = open_file_limits.first / 4 + else + DEFAULT_POOL_SIZE = 256 + end else DEFAULT_POOL_SIZE = 256 end |