read stdout and stderr concurrently
Avoids any buffering-related blocking.
This commit is contained in:
parent
3f23935a76
commit
475bf70af6
1 changed files with 4 additions and 2 deletions
|
@ -24,6 +24,7 @@ import qualified Git.Version
|
|||
|
||||
import qualified Data.Set as S
|
||||
import System.Process (std_out, std_err)
|
||||
import Control.Concurrent.Async
|
||||
|
||||
type MissingObjects = S.Set Sha
|
||||
|
||||
|
@ -53,8 +54,9 @@ findBroken batchmode r = do
|
|||
{ std_out = CreatePipe
|
||||
, std_err = CreatePipe
|
||||
}
|
||||
bad1 <- readMissingObjs r supportsNoDangling (stdoutHandle p)
|
||||
bad2 <- readMissingObjs r supportsNoDangling (stderrHandle p)
|
||||
(bad1, bad2) <- concurrently
|
||||
(readMissingObjs r supportsNoDangling (stdoutHandle p))
|
||||
(readMissingObjs r supportsNoDangling (stderrHandle p))
|
||||
fsckok <- checkSuccessProcess pid
|
||||
let badobjs = S.union bad1 bad2
|
||||
|
||||
|
|
Loading…
Reference in a new issue