summaryrefslogtreecommitdiff
path: root/src/buildstream/_loader
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-30 15:26:23 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-09-04 12:05:49 +0000
commit6b3da9429b18d93e2f1348b5758536e981e3bec2 (patch)
tree675e4167d883344af3f1ffe3fb1401385664f938 /src/buildstream/_loader
parent566a6a55d5d3c73809d6e43d819fa36702f0c231 (diff)
downloadbuildstream-6b3da9429b18d93e2f1348b5758536e981e3bec2.tar.gz
_loader.py: Cache how many Elements we load
Diffstat (limited to 'src/buildstream/_loader')
-rw-r--r--src/buildstream/_loader/loader.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py
index 89458d40c..b2dc7c1c3 100644
--- a/src/buildstream/_loader/loader.py
+++ b/src/buildstream/_loader/loader.py
@@ -62,6 +62,7 @@ class Loader():
# Public members
#
self.project = project # The associated Project
+ self.loaded = None # The number of loaded Elements
#
# Private members
@@ -146,6 +147,11 @@ class Loader():
self._clean_caches()
+ # Cache how many Elements have just been loaded
+ if task:
+ # Workaround for task potentially being None (because no State object)
+ self.loaded = task.current_progress
+
return ret
# get_state_for_child_job_pickling(self)