diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-25 14:52:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-25 15:23:21 +0100 |
commit | c22441f7025be012ad2e62a51ccb993c3a0e16c9 (patch) | |
tree | 4bb1bc0c81da14e07790907c89479860011fe9fb | |
parent | 14c31e18e4a4a52ee54056aeefb09ff8c295b475 (diff) | |
download | bitbake-contrib-c22441f7025be012ad2e62a51ccb993c3a0e16c9.tar.gz |
cache: Optimise invalid cache file handling
If there is a corrupt/invalid cache file, we'd keep trying to reopen
it. This is pointless, simplify the code paths and delete the dead
file.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/cache.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py index 6dedd4d59..c7f3b7ab7 100644 --- a/lib/bb/cache.py +++ b/lib/bb/cache.py @@ -823,9 +823,11 @@ class MultiProcessCache(object): p = pickle.Unpickler(fd) extradata, version = p.load() except (IOError, EOFError): - extradata, version = self.create_cachedata(), None + os.unlink(f) + continue if version != self.__class__.CACHE_VERSION: + os.unlink(f) continue self.merge_data(extradata, data) |