check-ignore resource pool

Much like check-attr before.
This commit is contained in:
Joey Hess 2020-04-21 11:20:10 -04:00
parent 45fb7af21c
commit 04352ed9c5
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 66 additions and 27 deletions

View file

@ -16,7 +16,7 @@ import qualified Git.CheckAttr as Git
import qualified Annex
import Utility.ResourcePool
import Types.Concurrency
import GHC.Conc
import Annex.Concurrent.Utility
{- All gitattributes used by git-annex. -}
annexAttrs :: [Git.Attr]
@ -54,13 +54,7 @@ mkConcurrentCheckAttrHandle c =
- while respecting the -Jn value.
-}
maxCheckAttrs :: Concurrency -> IO Int
maxCheckAttrs c = do
let cn = case c of
Concurrent n -> n
NonConcurrent -> 1
ConcurrentPerCpu -> 1
pn <- liftIO getNumProcessors
return (min cn pn)
maxCheckAttrs = concurrencyUpToCpus
checkAttrStop :: Annex ()
checkAttrStop = maybe noop stop =<< Annex.getState Annex.checkattrhandle