diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-09-09 18:46:29 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-09-10 16:53:57 +0900 |
commit | 8b748f2d7da2bc58627194a6fc68cb418489aeb6 (patch) | |
tree | 34d406cbe1d997cf714ef73f8c7de635c18d0942 | |
parent | cbfddc13ebe6a9be3cfe4bf62e9b996c45c5dcdc (diff) | |
download | buildstream-8b748f2d7da2bc58627194a6fc68cb418489aeb6.tar.gz |
_scheduler/jobs/cachesizejob.py: Use Platform.get_platform() public accessor
This was previously poking directly at the Platform._instance.
Also, use the name 'artifacts' to hold the artifact cache to
be consistent with other parts of the codebase, instead of
calling it 'cache'.
-rw-r--r-- | buildstream/_scheduler/jobs/cachesizejob.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/_scheduler/jobs/cachesizejob.py b/buildstream/_scheduler/jobs/cachesizejob.py index be682e3de..9c1a4bc97 100644 --- a/buildstream/_scheduler/jobs/cachesizejob.py +++ b/buildstream/_scheduler/jobs/cachesizejob.py @@ -24,13 +24,15 @@ class CacheSizeJob(Job): def __init__(self, *args, complete_cb, **kwargs): super().__init__(*args, **kwargs) self._complete_cb = complete_cb - self._cache = Platform._instance.artifactcache + + platform = Platform.get_platform() + self._artifacts = platform.artifactcache def child_process(self): - return self._cache.compute_cache_size() + return self._artifacts.compute_cache_size() def parent_complete(self, success, result): - self._cache.set_cache_size(result) + self._artifacts.set_cache_size(result) if self._complete_cb: self._complete_cb(result) |