summaryrefslogtreecommitdiff
path: root/Command/TransferKeys.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 15:50:03 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 15:53:38 -0400
commit7ca8bf3321d1b62ea4e817e28914ed2fa56afe30 (patch)
tree2d176cb156c749348d4805af31309a25bdc9f897 /Command/TransferKeys.hs
parentb94eafec8c4a7868da753f9b22ca823552e9764c (diff)
Avoid accumulating transfer failure log files unless the assistant is being used.
Only the assistant uses these, and only the assistant cleans them up, so make only git annex transferkeys write them, 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. Hope no-one depended on that old behavior.
Diffstat (limited to 'Command/TransferKeys.hs')
-rw-r--r--Command/TransferKeys.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Command/TransferKeys.hs b/Command/TransferKeys.hs
index b787fe9be..d490d9be4 100644
--- a/Command/TransferKeys.hs
+++ b/Command/TransferKeys.hs
@@ -36,14 +36,17 @@ start = do
where
runner (TransferRequest direction remote key file)
| direction == Upload = notifyTransfer direction file $
- upload (Remote.uuid remote) key file forwardRetry $ \p -> do
+ upload (Remote.uuid remote) key file forwardRetry observer $ \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 $ \p ->
+ download (Remote.uuid remote) key file forwardRetry observer $ \p ->
getViaTmp key $ \t -> Remote.retrieveKeyFile remote key file t p
+
+ observer False t info = recordFailedTransfer t info
+ observer True _ _ = noop
runRequests
:: Handle