assistant: Batch jobs are now run with ionice and nocache, when those commands are available.

This commit is contained in:
Joey Hess 2013-12-01 14:53:15 -04:00
parent 3c6be8cd6e
commit 4882a611e5
6 changed files with 42 additions and 31 deletions

View file

@ -37,17 +37,16 @@ data FsckResults = FsckFoundMissing MissingObjects | FsckFailed
-}
findBroken :: Bool -> Repo -> IO FsckResults
findBroken batchmode r = do
let (command, params) = ("git", fsckParams r)
(command', params') <- if batchmode
then toBatchCommand (command, params)
else return (command, params)
(output, fsckok) <- processTranscript command' (toCommand params') Nothing
let objs = findShas output
badobjs <- findMissing objs r
if S.null badobjs && not fsckok
then return FsckFailed
else return $ FsckFoundMissing badobjs
where
(command, params) = ("git", fsckParams r)
(command', params')
| batchmode = toBatchCommand (command, params)
| otherwise = (command, params)
foundBroken :: FsckResults -> Bool
foundBroken FsckFailed = True