Added the annex.fullybalancedthreshhold git config.
This commit is contained in:
parent
3fe67744b1
commit
70e2fca257
4 changed files with 6 additions and 3 deletions
|
@ -23,6 +23,7 @@ git-annex (10.20240831) UNRELEASED; urgency=medium
|
|||
* Added --rebalance option.
|
||||
* maxsize: New command to tell git-annex how large the expected maximum
|
||||
size of a repository is, and to display repository sizes.
|
||||
* Added the annex.fullybalancedthreshhold git config.
|
||||
* vicfg: Include maxsize configuration.
|
||||
* info: Improved speed.
|
||||
|
||||
|
|
2
Limit.hs
2
Limit.hs
|
@ -602,7 +602,7 @@ limitFullyBalanced' :: String -> Maybe UUID -> Annex GroupMap -> MkLimit Annex
|
|||
limitFullyBalanced' = limitFullyBalanced'' $ \n key candidates -> do
|
||||
maxsizes <- getMaxSizes
|
||||
sizemap <- getRepoSizes False
|
||||
let threshhold = 0.9 :: Double
|
||||
threshhold <- annexFullyBalancedThreshhold <$> Annex.getGitConfig
|
||||
let toofull u =
|
||||
case (M.lookup u maxsizes, M.lookup u sizemap) of
|
||||
(Just (MaxSize maxsize), Just (RepoSize reposize)) ->
|
||||
|
|
|
@ -163,6 +163,7 @@ data GitConfig = GitConfig
|
|||
, annexAdviceNoSshCaching :: Bool
|
||||
, annexViewUnsetDirectory :: ViewUnset
|
||||
, annexClusters :: M.Map RemoteName ClusterUUID
|
||||
, annexFullyBalancedThreshhold :: Double
|
||||
}
|
||||
|
||||
extractGitConfig :: ConfigSource -> Git.Repo -> GitConfig
|
||||
|
@ -296,6 +297,9 @@ extractGitConfig configsource r = GitConfig
|
|||
M.mapMaybe (mkClusterUUID . toUUID) $
|
||||
M.mapKeys removeclusterprefix $
|
||||
M.filterWithKey isclusternamekey (config r)
|
||||
, annexFullyBalancedThreshhold =
|
||||
fromMaybe 0.9 $ (/ 100) <$> getmayberead
|
||||
(annexConfig "fullybalancedthreshhold")
|
||||
}
|
||||
where
|
||||
getbool k d = fromMaybe d $ getmaybebool k
|
||||
|
|
|
@ -30,8 +30,6 @@ Planned schedule of work:
|
|||
|
||||
## work notes
|
||||
|
||||
* Implement annex.fullybalancedthreshhold
|
||||
|
||||
* `git-annex assist --rebalance` of `balanced=foo:2`
|
||||
sometimes needs several runs to stabalize.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue