sim: quiesce before freezing or ending
Probably a good idea for freezing, but especially I hope this fixes a problem with git-annex sim run that caused it to sometimes crash in removeDirectoryRecursive with directory not empty, presumably because a thread was writing there at the same time.
This commit is contained in:
parent
540bd5e1ab
commit
8047128591
2 changed files with 23 additions and 7 deletions
|
@ -33,9 +33,10 @@ seek ("show":[]) = do
|
|||
seek ("run":simfile:[]) = startsim' (Just simfile) >>= cleanup
|
||||
where
|
||||
cleanup st = do
|
||||
st' <- liftIO $ quiesceSim st
|
||||
endsim
|
||||
when (simFailed st) $ do
|
||||
showsim st
|
||||
when (simFailed st') $ do
|
||||
showsim st'
|
||||
giveup "Simulation shown above had errors."
|
||||
seek ps = case parseSimCommand ps of
|
||||
Left err -> giveup err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue