increase number of capabilities to match -Jn setting

This commit is contained in:
Joey Hess 2015-11-05 19:57:41 -04:00
parent 32fedcf56a
commit 5e2ea9c1a5
Failed to extract signature

View file

@ -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