allow Retriever action to update the progress meter
Needed for eg, Remote.External. Generally, any Retriever that stores content in a file is responsible for updating the meter, while ones that procude a lazy bytestring cannot update the meter, so are not asked to.
This commit is contained in:
parent
1d263e1e7e
commit
47e522979c
5 changed files with 46 additions and 29 deletions
|
@ -264,7 +264,10 @@ prepTmp key = do
|
|||
createAnnexDirectory (parentDir tmp)
|
||||
return tmp
|
||||
|
||||
{- Creates a temp file, runs an action on it, and cleans up the temp file. -}
|
||||
{- Creates a temp file for a key, runs an action on it, and cleans up
|
||||
- the temp file. If the action throws an exception, the temp file is
|
||||
- left behind, which allows for resuming.
|
||||
-}
|
||||
withTmp :: Key -> (FilePath -> Annex a) -> Annex a
|
||||
withTmp key action = do
|
||||
tmp <- prepTmp key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue