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

@ -15,6 +15,7 @@ import Types.Concurrency
import Types.WorkerPool
import Types.CatFileHandles
import Annex.CheckAttr
import Annex.CheckIgnore
import Remote.List
import Control.Concurrent
@ -31,10 +32,12 @@ setConcurrency c = do
CatFileHandlesNonConcurrent _ -> liftIO catFileHandlesPool
CatFileHandlesPool _ -> pure cfh
cah <- mkConcurrentCheckAttrHandle c
cih <- mkConcurrentCheckIgnoreHandle c
Annex.changeState $ \s -> s
{ Annex.concurrency = c
, Annex.catfilehandles = cfh'
, Annex.checkattrhandle = Just cah
, Annex.checkignorehandle = Just cih
}
{- Allows forking off a thread that uses a copy of the current AnnexState
@ -79,8 +82,6 @@ dupState = do
return $ st'
-- each thread has its own repoqueue
{ Annex.repoqueue = Nothing
-- avoid sharing open file handles
, Annex.checkignorehandle = Nothing
}
{- Merges the passed AnnexState into the current Annex state.