From 60784a16a1ecf0f9a2b02dbe7c55a7f40de08993 Mon Sep 17 00:00:00 2001 From: Jakauppila Date: Tue, 27 Jun 2017 23:21:37 -0500 Subject: [PATCH] Sets a default pool size for Windows as Process::RLIMIT_NOFILE is not supported --- lib/net/http/persistent.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/net/http/persistent.rb b/lib/net/http/persistent.rb index e6a110c..1cf4785 100644 --- a/lib/net/http/persistent.rb +++ b/lib/net/http/persistent.rb @@ -202,7 +202,11 @@ class Net::HTTP::Persistent ## # The default connection pool size is 1/4 the allowed open files. - DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4 + if Gem.win_platform? then + DEFAULT_POOL_SIZE = 256 + else + DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4 + end ## # The version of Net::HTTP::Persistent you are using