, providedMimeEncoding = Nothing
, providedLinkType = Nothing
}
- bwlimit <- bwLimit (Remote.gitconfig remote)
+ let bwlimit = remoteAnnexBwLimit (Remote.gitconfig remote)
islargefile <- checkMatcher' matcher mi mempty
metered Nothing sz bwlimit $ const $ if islargefile
then doimportlarge importkey cidmap db loc cid sz f
Left e -> do
warning (show e)
return Nothing
- bwlimit <- bwLimit (Remote.gitconfig remote)
+ let bwlimit = remoteAnnexBwLimit (Remote.gitconfig remote)
checkDiskSpaceToGet tmpkey Nothing $
notifyTransfer Download af $
download' (Remote.uuid remote) tmpkey af Nothing stdRetry $ \p ->
noRetry,
stdRetry,
pickRemote,
- bwLimit,
) where
import Annex.Common
lessActiveFirst active a b
| Remote.cost a == Remote.cost b = comparing (`M.lookup` active) a b
| otherwise = comparing Remote.cost a b
-
-bwLimit :: RemoteGitConfig -> Annex (Maybe BwRate)
-bwLimit gc = maybe globalcfg (pure . Just) remotecfg
- where
- globalcfg = annexBwLimit <$> Annex.getGitConfig
- remotecfg = remoteAnnexBwLimit gc
| not $ Git.repoIsUrl repo = guardUsable repo (giveup "cannot access remote") $ do
u <- getUUID
hardlink <- wantHardLink
- bwlimit <- bwLimit (gitconfig r)
+ let bwlimit = remoteAnnexBwLimit (gitconfig r)
-- run copy from perspective of remote
onLocalFast st $ Annex.Content.prepSendAnnex' key >>= \case
Just (object, check) -> do
checkio <- Annex.withCurrentState check
u <- getUUID
hardlink <- wantHardLink
- bwlimit <- bwLimit (gitconfig r)
+ let bwlimit = remoteAnnexBwLimit (gitconfig r)
-- run copy from perspective of remote
res <- onLocalFast st $ ifM (Annex.Content.inAnnex key)
( return True
import Utility.Metered
import Types.NumCopies
import Annex.Verify
-import Annex.Transfer
import Control.Concurrent
store :: RemoteGitConfig -> (MeterUpdate -> ProtoRunner Bool) -> Key -> AssociatedFile -> MeterUpdate -> Annex ()
store gc runner k af p = do
let sizer = KeySizer k (fmap (toRawFilePath . fst) <$> prepSendAnnex k)
- bwlimit <- bwLimit gc
+ let bwlimit = remoteAnnexBwLimit gc
metered (Just p) sizer bwlimit $ \_ p' ->
runner p' (P2P.put k af p') >>= \case
Just True -> return ()
retrieve :: RemoteGitConfig -> (MeterUpdate -> ProtoRunner (Bool, Verification)) -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> VerifyConfig -> Annex Verification
retrieve gc runner k af dest p verifyconfig = do
iv <- startVerifyKeyContentIncrementally verifyconfig k
- bwlimit <- bwLimit gc
+ let bwlimit = remoteAnnexBwLimit gc
metered (Just p) k bwlimit $ \m p' ->
runner p' (P2P.get dest k iv af m p') >>= \case
Just (True, v) -> return v
import Types.Remote
import Annex.Verify
import Annex.UUID
-import Annex.Transfer
import Config
import Config.Cost
import Utility.Metered
displayprogress p k srcfile a
| displayProgress cfg = do
- bwlimit <- bwLimit (gitconfig baser)
+ let bwlimit = remoteAnnexBwLimit (gitconfig baser)
metered (Just p) (KeySizer k (pure (fmap toRawFilePath srcfile))) bwlimit (const a)
| otherwise = a p
, annexRetry :: Maybe Integer
, annexForwardRetry :: Maybe Integer
, annexRetryDelay :: Maybe Seconds
- , annexBwLimit :: Maybe BwRate
, annexAllowedUrlSchemes :: S.Set Scheme
, annexAllowedIPAddresses :: String
, annexAllowUnverifiedDownloads :: Bool
, annexForwardRetry = getmayberead (annexConfig "forward-retry")
, annexRetryDelay = Seconds
<$> getmayberead (annexConfig "retrydelay")
- , annexBwLimit =
- either (const Nothing) Just . parseBwRate
- =<< getmaybe (annexConfig "bwlimit")
, annexAllowedUrlSchemes = S.fromList $ map mkScheme $
maybe ["http", "https", "ftp"] words $
getmaybe (annexConfig "security.allowed-url-schemes")