From 5e2ea9c1a55dbcc031bfe20709f60d482b7cadfc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Nov 2015 19:57:41 -0400 Subject: [PATCH] increase number of capabilities to match -Jn setting --- CmdLine/GitAnnex/Options.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs index b004e42398..7d8bcadeeb 100644 --- a/CmdLine/GitAnnex/Options.hs +++ b/CmdLine/GitAnnex/Options.hs @@ -9,6 +9,7 @@ module CmdLine.GitAnnex.Options where import Options.Applicative import Options.Applicative.Builder.Internal +import Control.Concurrent import Common.Annex import qualified Git.Config @@ -292,7 +293,11 @@ jobsOption = globalSetter set $ <> hidden ) where - set n = Annex.changeState $ \s -> s { Annex.concurrentjobs = Just n } + set n = do + Annex.changeState $ \s -> s { Annex.concurrentjobs = Just n } + c <- liftIO getNumCapabilities + when (n > c) $ + liftIO $ setNumCapabilities n timeLimitOption :: GlobalOption timeLimitOption = globalSetter Limit.addTimeLimit $ strOption -- 2.30.2