avoid hanging on exception
This commit is contained in:
parent
bff5694f55
commit
918b1faa3d
3 changed files with 20 additions and 6 deletions
|
@ -267,19 +267,21 @@ seekFiltered a fs = do
|
||||||
|
|
||||||
-- This is significantly faster than using lookupKey after seekFiltered.
|
-- This is significantly faster than using lookupKey after seekFiltered.
|
||||||
seekFilteredKeys :: (RawFilePath -> Key -> CommandSeek) -> Annex [(RawFilePath, Git.Sha, FileMode)] -> Annex ()
|
seekFilteredKeys :: (RawFilePath -> Key -> CommandSeek) -> Annex [(RawFilePath, Git.Sha, FileMode)] -> Annex ()
|
||||||
seekFilteredKeys a fs = do
|
seekFilteredKeys a listfs = do
|
||||||
g <- Annex.gitRepo
|
g <- Annex.gitRepo
|
||||||
matcher <- Limit.getMatcher
|
matcher <- Limit.getMatcher
|
||||||
|
-- Run here, not in the async, because it could throw an exception
|
||||||
|
-- The list should be built lazily.
|
||||||
|
l <- listfs
|
||||||
catObjectStream g $ \feeder closer reader -> do
|
catObjectStream g $ \feeder closer reader -> do
|
||||||
processertid <- liftIO . async =<< forkState
|
processertid <- liftIO . async =<< forkState
|
||||||
(gofeed matcher feeder closer)
|
(gofeed l matcher feeder closer)
|
||||||
goread reader
|
goread reader
|
||||||
join (liftIO (wait processertid))
|
join (liftIO (wait processertid))
|
||||||
where
|
where
|
||||||
gofeed matcher feeder closer = do
|
gofeed l matcher feeder closer =
|
||||||
l <- fs
|
forM_ l (process matcher feeder)
|
||||||
forM_ l $ process matcher feeder
|
`finally` liftIO closer
|
||||||
liftIO closer
|
|
||||||
|
|
||||||
goread reader = liftIO reader >>= \case
|
goread reader = liftIO reader >>= \case
|
||||||
Just (f, content) -> do
|
Just (f, content) -> do
|
||||||
|
|
|
@ -50,3 +50,5 @@ git-annex: Not recursively setting metadata. Use --force to do that.
|
||||||
|
|
||||||
[[!meta author=kyle]]
|
[[!meta author=kyle]]
|
||||||
[[!tag projects/datalad]]
|
[[!tag projects/datalad]]
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 1"""
|
||||||
|
date="2020-07-13T16:24:55Z"
|
||||||
|
content="""
|
||||||
|
Aha, seekFilteredKeys is not prepared for the file list action that's
|
||||||
|
passed to it to throw an exception, but in this one case at least, it can.
|
||||||
|
|
||||||
|
Thanks for reporting, I've fixed it.
|
||||||
|
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue