diff options
author | Joey Hess <joeyh@joeyh.name> | 2018-06-23 18:16:37 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2018-06-24 17:31:22 -0400 |
commit | a5228ac76572463a52072fbbc5913bbe0e092ec0 (patch) | |
tree | 7253528b096c4ec1018b5724dd91b9200e9c271e | |
parent | b6ae4c05097d3d5d3732e63b3f1d5974739c6f2b (diff) |
Support configuring remote.web.annex-cost and remote.bittorrent.annex-cost
Seems that has never worked before due to oversight.
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | Remote/BitTorrent.hs | 6 | ||||
-rw-r--r-- | Remote/Web.hs | 6 |
3 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,6 @@ + + * Support configuring remote.web.annex-cost and remote.bittorrent.annex-cost + git-annex (6.20180530) UNRELEASED; urgency=medium * Fix build with ghc 8.4+, which broke due to the Semigroup Monoid change. diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs index 8cc559d917..3246153c4a 100644 --- a/Remote/BitTorrent.hs +++ b/Remote/BitTorrent.hs @@ -14,6 +14,7 @@ import Types.Remote import qualified Annex import qualified Git import qualified Git.Construct +import Config import Config.Cost import Logs.Web import Types.UrlContents @@ -51,10 +52,11 @@ list _autoinit = do return [r] gen :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex (Maybe Remote) -gen r _ c gc = +gen r _ c gc = do + cst <- remoteCost gc expensiveRemoteCost return $ Just Remote { uuid = bitTorrentUUID - , cost = expensiveRemoteCost + , cost = cst , name = Git.repoDescribe r , storeKey = uploadKey , retrieveKeyFile = downloadKey diff --git a/Remote/Web.hs b/Remote/Web.hs index 03cbe706d5..0cff68ceba 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -15,6 +15,7 @@ import qualified Git import qualified Git.Construct import Annex.Content import Config.Cost +import Config import Logs.Web import Annex.UUID import Messages.Progress @@ -40,10 +41,11 @@ list _autoinit = do return [r] gen :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex (Maybe Remote) -gen r _ c gc = +gen r _ c gc = do + cst <- remoteCost gc expensiveRemoteCost return $ Just Remote { uuid = webUUID - , cost = expensiveRemoteCost + , cost = cst , name = Git.repoDescribe r , storeKey = uploadKey , retrieveKeyFile = downloadKey |