diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-11-05 19:57:41 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-11-05 19:57:41 -0400 |
commit | 393d156deb01a71031c3a7ff6fe87d5e945b619e (patch) | |
tree | 56615427e6d6ccf7d1ec407dfc86c786e5d5a55a | |
parent | ee862923fe00d6c73bf0a0a429dc6f24c1c545fc (diff) |
increase number of capabilities to match -Jn setting
-rw-r--r-- | CmdLine/GitAnnex/Options.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs index b004e4239..7d8bcadee 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 |