From b3dc4ccff528bbb79d26ee4631575092488559ce Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Mar 2018 10:37:25 -0400 Subject: [PATCH] add retry configuration (not used yet) --- Types/GitConfig.hs | 11 ++++++++++- doc/git-annex.mdwn | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index 4b89a6bdcf..19ffaf8ff4 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -90,6 +90,8 @@ data GitConfig = GitConfig , annexPidLockTimeout :: Seconds , annexAddUnlocked :: Bool , annexSecureHashesOnly :: Bool + , annexRetry :: Maybe Integer + , annexRetryDelay :: Maybe Seconds , coreSymlinks :: Bool , coreSharedRepository :: SharedRepository , receiveDenyCurrentBranch :: DenyCurrentBranch @@ -154,6 +156,9 @@ extractGitConfig r = GitConfig getmayberead (annex "pidlocktimeout") , annexAddUnlocked = getbool (annex "addunlocked") False , annexSecureHashesOnly = getbool (annex "securehashesonly") False + , annexRetry = getmayberead (annex "retry") + , annexRetryDelay = Seconds + <$> getmayberead (annex "retrydelay") , coreSymlinks = getbool "core.symlinks" True , coreSharedRepository = getSharedRepository r , receiveDenyCurrentBranch = getDenyCurrentBranch r @@ -208,6 +213,8 @@ data RemoteGitConfig = RemoteGitConfig , remoteAnnexStopCommand :: Maybe String , remoteAnnexAvailability :: Maybe Availability , remoteAnnexBare :: Maybe Bool + , remoteAnnexRetry :: Maybe Integer + , remoteAnnexRetryDelay :: Maybe Seconds {- These settings are specific to particular types of remotes - including special remotes. -} @@ -259,7 +266,9 @@ extractRemoteGitConfig r remotename = do , remoteAnnexStopCommand = notempty $ getmaybe "stop-command" , remoteAnnexAvailability = getmayberead "availability" , remoteAnnexBare = getmaybebool "bare" - + , remoteAnnexRetry = getmayberead "retry" + , remoteAnnexRetryDelay = Seconds + <$> getmayberead "retrydelay" , remoteAnnexShell = getmaybe "shell" , remoteAnnexSshOptions = getoptions "ssh-options" , remoteAnnexRsyncOptions = getoptions "rsync-options" diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 93ecb15084..48ab40bb47 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -1248,6 +1248,18 @@ Here are all the supported configuration settings. git-annex caches UUIDs of remote repositories here. +* `remote..annex-retry`, `annex.retry` + + Configure retries of failed transfers on a per-remote and general + basis, respectively. The value is the number of retries that can be + made of the same transfer. (default 0) + +* `remote..annex-retry-delay`, `annex.retry-delay` + + Number of seconds to delay before the first retry of a transfer. + When making multiple retries of the same transfer, the delay + doubles after each retry. (default 1) + * `remote..annex-checkuuid` This only affects remotes that have their url pointing to a directory on