Re-enable accumulating transfer failure log files for command-line actions

This was disabled in commit 61ccf95004,
because only the assistant used them, and they were clutter. But, now
--failed also uses them.

Remove the failure log files after successful transfers. Should avoid
most of the clutter problems.

Commit 61ccf95004 mentions a subtle behavior
change, which has now been reverted:

    There is one behavior change from this. If glacier is being used, and a
    manual git annex get --from glacier fails because the file isn't available
    yet, the assistant will no longer later see that failed transfer file and
    retry the get.
This commit is contained in:
Joey Hess 2016-08-03 13:41:07 -04:00
parent 1a0e2c9901
commit f461bcae4b
Failed to extract signature
4 changed files with 12 additions and 8 deletions

View file

@ -94,8 +94,12 @@ runTransfer' ignorelock t file shouldretry transferobserver transferaction = do
return observeFailure
else do
v <- retry info metervar $ transferaction meter
let ok = observeBool v
liftIO $ cleanup tfile lck
transferobserver (observeBool v) t info
if ok
then removeFailedTransfer t
else recordFailedTransfer t info
transferobserver ok t info
return v
where
#ifndef mingw32_HOST_OS

View file

@ -22,6 +22,9 @@ git-annex (6.20160726) UNRELEASED; urgency=medium
the content is present locally.
* get, move, copy, mirror: Added --failed switch which retries
failed copies/moves.
* Re-enable accumulating transfer failure log files for command-line
actions (disabled in 5.20150522), and remove the log files after
successful transfers.
-- Joey Hess <id@joeyh.name> Wed, 20 Jul 2016 12:03:15 -0400

View file

@ -35,13 +35,13 @@ start = do
where
runner (TransferRequest direction remote key file)
| direction == Upload = notifyTransfer direction file $
upload (Remote.uuid remote) key file forwardRetry observer $ \p -> do
upload (Remote.uuid remote) key file forwardRetry noObserver $ \p -> do
ok <- Remote.storeKey remote key file p
when ok $
Remote.logStatus remote key InfoPresent
return ok
| otherwise = notifyTransfer direction file $
download (Remote.uuid remote) key file forwardRetry observer $ \p ->
download (Remote.uuid remote) key file forwardRetry noObserver $ \p ->
getViaTmp (RemoteVerify remote) key $ \t -> do
r <- Remote.retrieveKeyFile remote key file t p
-- Make sure we get the current
@ -49,9 +49,6 @@ start = do
-- not old cached data.
Database.Keys.closeDb
return r
observer False t tinfo = recordFailedTransfer t tinfo
observer True _ _ = noop
runRequests
:: Handle

View file

@ -3,6 +3,6 @@
subject="""comment 1"""
date="2016-08-03T15:07:43Z"
content="""
Nice idea, and there's already a log of recent failed transfers that
could be used.
Nice idea, and there's already an implementation of a log of recent failed
transfers that the assistant uses, that can be reused for this.
"""]]