differentiate between concurrency enabled at command line and by git config
The latter should not affect --batch mode.
This commit is contained in:
parent
8471df3b6d
commit
77c42782d0
9 changed files with 46 additions and 21 deletions
|
@ -7,10 +7,18 @@
|
|||
|
||||
module Annex.Concurrent.Utility where
|
||||
|
||||
import Annex
|
||||
import Types.Concurrency
|
||||
|
||||
import GHC.Conc
|
||||
|
||||
getConcurrency :: Annex Concurrency
|
||||
getConcurrency = getConcurrency' <$> getState concurrency
|
||||
|
||||
getConcurrency' :: ConcurrencySetting -> Concurrency
|
||||
getConcurrency' (ConcurrencyCmdLine c) = c
|
||||
getConcurrency' (ConcurrencyGitConfig c) = c
|
||||
|
||||
{- Honor the requested level of concurrency, but only up to the number of
|
||||
- CPU cores. Useful for things that are known to be CPU bound. -}
|
||||
concurrencyUpToCpus :: Concurrency -> IO Int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue