diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-01 15:18:40 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-01 15:18:40 +0000 |
commit | c4e29c307c168b40b595983b16b7507fe9e09742 (patch) | |
tree | 6767eb2f6f2e2440a2fb61d0bd848333d628e69a | |
parent | 7a407926fce8a289e2fc1cbecba92bb7a83d5970 (diff) | |
parent | 3b277df80cb0543256f0514bbc1994a29688e059 (diff) | |
download | buildstream-c4e29c307c168b40b595983b16b7507fe9e09742.tar.gz |
Merge branch 'aevri/nonecach2' into 'master'
cascache: limit 'infinite' cache to volume size
Closes #906
See merge request BuildStream/buildstream!1196
-rw-r--r-- | buildstream/_cas/cascache.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py index ffc9c2b93..802fc13fd 100644 --- a/buildstream/_cas/cascache.py +++ b/buildstream/_cas/cascache.py @@ -1226,8 +1226,9 @@ class CASQuota: # Also check that cache_quota is at least as large as our headroom. # cache_quota = self._config_cache_quota - if cache_quota is None: # Infinity, set to max system storage - cache_quota = cache_size + available_space + if cache_quota is None: + # The user has set no limit, so we may take all the space. + cache_quota = min(cache_size + available_space, total_size) if cache_quota < self._cache_quota_headroom: # Check minimum raise LoadError( LoadErrorReason.INVALID_DATA, |