diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-26 10:02:30 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-26 10:02:30 +0100 |
commit | 8c41b5b8cefcaeb98e163324d07e4441a8b5edf6 (patch) | |
tree | f11db91899e6d5c9c6f89d4e46fe599e061e3f23 | |
parent | 356d84cdce6c44516d09ab561e10545434e4a609 (diff) | |
download | buildstream-8c41b5b8cefcaeb98e163324d07e4441a8b5edf6.tar.gz |
_yaml.py: Do not insert into cache if retrieved from cache
We were unconditionally inserting into the yaml cache anything we had
retrieved from the yaml cache. This had the side-effect of being expensive
on re-runs of commands where yaml hadn't changed.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r-- | buildstream/_yaml.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py index 90784636d..940ca81e5 100644 --- a/buildstream/_yaml.py +++ b/buildstream/_yaml.py @@ -204,9 +204,8 @@ def load(filename, shortname=None, copy_tree=False, *, project=None, yaml_cache= if not data: data = load_data(contents, file, copy_tree=copy_tree) - - if yaml_cache: - yaml_cache.put_from_key(project, filename, key, data) + if yaml_cache: + yaml_cache.put_from_key(project, filename, key, data) return data except FileNotFoundError as e: |