You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by gi...@apache.org on 2020/12/29 13:07:11 UTC
[buildstream] 03/04: cascache.py: Make calculate_cache_quota public
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch jennis/cache_quota
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 7fa7b5c6ed9a228e5b5a6c01ff9790b13b5da30a
Author: James Ennis <ja...@codethink.co.uk>
AuthorDate: Thu Apr 25 12:59:30 2019 +0100
cascache.py: Make calculate_cache_quota public
---
buildstream/_cas/cascache.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py
index 647ece5..7933fa6 100644
--- a/buildstream/_cas/cascache.py
+++ b/buildstream/_cas/cascache.py
@@ -59,7 +59,7 @@ class CASCacheUsage():
def __init__(self, casquota):
if not casquota._cache_quota_original:
- casquota._calculate_cache_quota()
+ casquota.calculate_cache_quota()
self.quota_config = casquota._config_cache_quota # Configured quota
self.quota_size = casquota._cache_quota_original # Resolved cache quota in bytes
self.used_size = casquota.get_cache_size() # Size used by artifacts in bytes
@@ -1219,7 +1219,7 @@ class CASQuota:
def full(self):
if not self._cache_quota:
- self._calculate_cache_quota()
+ self.calculate_cache_quota()
if self.get_cache_size() > self._cache_quota:
return True
@@ -1287,14 +1287,14 @@ class CASQuota:
def _get_cache_volume_size(self):
return utils._get_volume_size(self.casdir)
- # _calculate_cache_quota()
+ # calculate_cache_quota()
#
# Calculates and sets the cache quota and lower threshold based on the
# quota set in Context.
# It checks that the quota is both a valid expression, and that there is
# enough disk space to satisfy that quota
#
- def _calculate_cache_quota(self):
+ def calculate_cache_quota(self):
# Headroom intended to give BuildStream a bit of leeway.
# This acts as the minimum size of cache_quota and also
# is taken from the user requested cache_quota.