testremote: Test retrieveKeyFile resume
And fixed a bug found by these tests; retrieveKeyFile would fail when the dest file was already complete. This commit was sponsored by Bradley Unterrheiner.
This commit is contained in:
parent
20d7295386
commit
3991327d09
2 changed files with 45 additions and 17 deletions
|
@ -241,7 +241,9 @@ retrieveChunks retriever u chunkconfig encryptor basek dest basep sink
|
|||
currsize <- liftIO $ catchMaybeIO $
|
||||
toInteger . fileSize <$> getFileStatus dest
|
||||
let ls' = maybe ls (setupResume ls) currsize
|
||||
firstavail currsize ls' `catchNonAsyncAnnex` giveup
|
||||
if any (== 0) (map length ls')
|
||||
then return True -- dest is already complete
|
||||
else firstavail currsize ls' `catchNonAsyncAnnex` giveup
|
||||
|
||||
giveup e = do
|
||||
warning (show e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue