make the assistant retry failed transfers

When a transfer fails, the progress info can be used to intelligently
retry it. If the transfer managed to make some progress, but did not
fully complete, then there's a good chance that a retry will finish it
(or at least make more progress).
This commit is contained in:
Joey Hess 2012-09-23 13:27:13 -04:00
parent d4055b3dd2
commit df07ccf404
6 changed files with 37 additions and 17 deletions

View file

@ -89,7 +89,7 @@ toPerform dest move key file = moveLock move key $ do
stop
Right False -> do
showAction $ "to " ++ Remote.name dest
ok <- upload (Remote.uuid dest) key (Just file) $
ok <- upload (Remote.uuid dest) key (Just file) noRetry $
Remote.storeKey dest key (Just file)
if ok
then finish
@ -138,7 +138,7 @@ fromPerform src move key file = moveLock move key $
, handle move =<< go
)
where
go = download (Remote.uuid src) key (Just file) $ do
go = download (Remote.uuid src) key (Just file) noRetry $ do
showAction $ "from " ++ Remote.name src
getViaTmp key $ Remote.retrieveKeyFile src key (Just file)
handle _ False = stop -- failed