aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-02-23 14:44:14 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-02-23 14:44:14 -0800
commit45f28da0876f572b0bc5d81b7baeefda1b2b108f (patch)
treeb6507a93872967fb9f85a30706d96d278f53c055 /lib
parenthello linux (diff)
downloadbackend-45f28da0876f572b0bc5d81b7baeefda1b2b108f.tar.gz
backend-45f28da0876f572b0bc5d81b7baeefda1b2b108f.tar.bz2
backend-45f28da0876f572b0bc5d81b7baeefda1b2b108f.zip
Include a --jobs parameter.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/utils.rb b/lib/utils.rb
index 0213c6d..b37437b 100644
--- a/lib/utils.rb
+++ b/lib/utils.rb
@@ -67,8 +67,15 @@ module Ag
''
end
+ @proc_count = nil
+ def proc_count=(cnt)
+ cnt = nil if cnt == false
+ @proc_count = cnt
+ end
+
def proc_count
+ return @proc_count unless @proc_count.nil? or @proc_count == false
(Parallel::ProcessorCount.processor_count.to_f * 0.75).floor
end
end
-end \ No newline at end of file
+end