diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-03-13 15:55:21 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-21 15:58:17 +0000 |
commit | fcc35a8ce9f2c5cdadb7e5f486b8f14ab5a515c3 (patch) | |
tree | a657bd1ffda579ffc33c6c0018ede86e49c1aee2 | |
parent | f7a79ff0aee5b2a85cd1913b83056742aaa1f2ed (diff) | |
download | buildstream-fcc35a8ce9f2c5cdadb7e5f486b8f14ab5a515c3.tar.gz |
cascache: rm redundant calculate_cache_size
It seems that `CASQuota.calculate_cache_size` had historical significance,
but is now not necessary. Inline it into `CASQuota.compute_cache_size`
to make things simpler. Also remove a redundant compare and assign.
-rw-r--r-- | buildstream/_cas/cascache.py | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py index aece69fd6..086510bf7 100644 --- a/buildstream/_cas/cascache.py +++ b/buildstream/_cas/cascache.py @@ -1064,31 +1064,15 @@ class CASQuota: # compute_cache_size() # - # Computes the real artifact cache size by calling - # the abstract calculate_cache_size() method. + # Computes the real artifact cache size. # # Returns: # (int): The size of the artifact cache. # def compute_cache_size(self): - old_cache_size = self._cache_size - new_cache_size = self.calculate_cache_size() - - if old_cache_size != new_cache_size: - self._cache_size = new_cache_size - + self._cache_size = utils._get_dir_size(self.casdir) return self._cache_size - # calculate_cache_size() - # - # Return the real disk usage of the CAS cache. - # - # Returns: - # (int): The size of the cache. - # - def calculate_cache_size(self): - return utils._get_dir_size(self.casdir) - # get_cache_size() # # Fetches the cached size of the cache, this is sometimes |