Skip to content

Commit 43c9805

Browse files
committed
Ensure not to use old concurrent-ruby
It seems that some users encounter with a negative values issue of `Concurrent.available_processor_count`. #349 (comment) To avoid the issue, this PR ensure not to use old `concurrent-ruby`. This PR also removes considering of `NoMethodError` because we can assume to use `available_processor_count` always.
1 parent ab06d9e commit 43c9805

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/parallel.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,10 @@ def instrument_start(item, index, options)
697697
end
698698

699699
def available_processor_count
700+
gem 'concurrent-ruby', '>= 1.3.4'
700701
require 'concurrent-ruby'
701702
Concurrent.available_processor_count.floor
702-
rescue LoadError, NoMethodError
703+
rescue LoadError
703704
require 'etc'
704705
Etc.nprocessors
705706
end

0 commit comments

Comments
 (0)