diff options
author | Jürg Billeter <j@bitron.ch> | 2019-06-13 17:43:11 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-20 07:41:23 +0200 |
commit | 904f77f01267b4607a2f0bd3687d8b6e6d296ec8 (patch) | |
tree | 0000df57a7d31a92103f26e3b6d03f0b62481de3 /src/buildstream/_scheduler/jobs | |
parent | 147dd700fa9bf9634e23c8a38173ca49699570c6 (diff) | |
download | buildstream-904f77f01267b4607a2f0bd3687d8b6e6d296ec8.tar.gz |
_scheduler: Remove cache size job
Cache size will be tracked by buildbox-casd.
Diffstat (limited to 'src/buildstream/_scheduler/jobs')
-rw-r--r-- | src/buildstream/_scheduler/jobs/__init__.py | 1 | ||||
-rw-r--r-- | src/buildstream/_scheduler/jobs/cachesizejob.py | 48 |
2 files changed, 0 insertions, 49 deletions
diff --git a/src/buildstream/_scheduler/jobs/__init__.py b/src/buildstream/_scheduler/jobs/__init__.py index 96062089f..9f081c8a0 100644 --- a/src/buildstream/_scheduler/jobs/__init__.py +++ b/src/buildstream/_scheduler/jobs/__init__.py @@ -18,5 +18,4 @@ # Tristan Maat <tristan.maat@codethink.co.uk> from .elementjob import ElementJob -from .cachesizejob import CacheSizeJob from .job import JobStatus diff --git a/src/buildstream/_scheduler/jobs/cachesizejob.py b/src/buildstream/_scheduler/jobs/cachesizejob.py deleted file mode 100644 index 581101c07..000000000 --- a/src/buildstream/_scheduler/jobs/cachesizejob.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2018 Codethink Limited -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library. If not, see <http://www.gnu.org/licenses/>. -# -# Author: -# Tristan Daniël Maat <tristan.maat@codethink.co.uk> -# -from .job import Job, JobStatus, ChildJob - - -class CacheSizeJob(Job): - def __init__(self, *args, complete_cb, **kwargs): - super().__init__(*args, **kwargs) - self.set_name(self.action_name) - self._complete_cb = complete_cb - - context = self._scheduler.context - self._casquota = context.get_casquota() - - def parent_complete(self, status, result): - if status is JobStatus.OK: - self._casquota.set_cache_size(result) - - if self._complete_cb: - self._complete_cb(status, result) - - def create_child_job(self, *args, **kwargs): - return ChildCacheSizeJob(*args, casquota=self._scheduler.context._casquota, **kwargs) - - -class ChildCacheSizeJob(ChildJob): - def __init__(self, *args, casquota, **kwargs): - super().__init__(*args, **kwargs) - self._casquota = casquota - - def child_process(self): - return self._casquota.compute_cache_size() |