implement getRepoSizes
At this point the RepoSize database is getting populated, and it all seems to be working correctly. Incremental updates still need to be done to make it performant.
This commit is contained in:
parent
bba23e7cc9
commit
c200523bac
3 changed files with 60 additions and 49 deletions
6
Limit.hs
6
Limit.hs
|
@ -598,12 +598,10 @@ limitFullyBalanced mu getgroupmap groupname = Right $ MatchFiles
|
|||
let groupmembers = fromMaybe S.empty $
|
||||
M.lookup g (uuidsByGroup gm)
|
||||
maxsizes <- getMaxSizes
|
||||
-- XXX do not calc this every time!
|
||||
(sizemap, sha) <- calcBranchRepoSizes
|
||||
sizemap' <- journalledRepoSizes sizemap sha
|
||||
sizemap <- getRepoSizes
|
||||
let keysize = fromMaybe 0 (fromKey keySize key)
|
||||
currentlocs <- S.fromList <$> loggedLocations key
|
||||
let hasspace u = case (M.lookup u maxsizes, M.lookup u sizemap') of
|
||||
let hasspace u = case (M.lookup u maxsizes, M.lookup u sizemap) of
|
||||
(Just (MaxSize maxsize), Just (RepoSize reposize)) ->
|
||||
if u `S.member` currentlocs
|
||||
then reposize <= maxsize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue